Git: nano on Windows

When you’re developing on two different OS’ (e.g Windows & Linux), the last thing you want to do is have to remember which tools to use on which system. I think we’d all agree that life would be a lot easier if we had a seamless experience between the two. That is where nano comes in to play.

Installing nano on Linux is as easy as apt-get install nano, however, installing it on Windows isn’t as straight forward. Following the Installing Git on Windows results in MINGW64 being installed. Therefore we’ll need to get nano working in MINGW64 and we’ll have an identical git experience to what we have on Linux.

To achieve this we need to do the following:

  1. Download nano for Windows
  2. Rename the file to nano.exe
  3. Move it to C:\Program Files\Git\usr\bin
  4. Open git for Windows and issue the following command:  git config --global core.editor "winpty nano"

And that’s it! Next git opens a text editor, it will be nano run inside of MINGW64.

Knowledge Base

See the Git section of my Knowledge Base for more information.

As always, if you have any questions or have a topic that you would like me to discuss, please feel free to post a comment at the bottom of this blog entry, e-mail at will@oznetnerd.com, or drop me a message on Twitter (@OzNetNerd).

Note: This website is my personal blog. The opinions expressed in this blog are my own and not those of my employer.

Leave a Reply

Your email address will not be published. Required fields are marked *