How to install nano for git on windows?

  • This is an attempt to "poke a finger into the sky": coderwall.com/p/ee-law/use-nano-from-git-bash-on-windows-d // but in general it is better to clarify in the question from where in ms / windows took the bash program. then the answer may be more specific. - aleksandr barakin
  • one
    <sarcasm> run bash then apt-get nano . Win10 TP works for me in </ sarcasm> - pavel
  • 2
    Run git config core.editor notepad and use a regular notepad. - KoVadim
  • @KoVAdim thanks! cool! helped - buyboy
  • @pavel thanks - I will try somehow - buyboy

1 answer 1

nano is not installed on Git on Windows, but on MSYS — the GNU environment port (consoles, utilities, and libraries) under Windows. A Git build for Windows simply includes MSYS in its package.

How to install nano in MSYS is well described in the article “ Nano with mingw32 for msysgit ”. Below is her translation.

If you are an ardent fan of git and a devoted fan of nano , but have to work under Windows, then you may be disappointed in msysgit . It uses the shell included in the mingw32 shell as a git bash , but it does not provide the ability to edit text files using nano . Instead, you are forced to use vi or vim . Fortunately, I found a way to solve this problem.

Download WinNT / 9x binary, .zip format from the nano download page . Unzip the archive and rename the extracted nano-2.xx folder to nano .

Then move it to the git share folder. In my case, it was located at C:\Program Files\Git\share . There you will find the subfolders vi and vim .

Create a text file on your desktop with the name nano (without extension) and the following contents:

 #!/bin/sh exec /share/nano/nano.exe "$@" 

Move the file to the git's bin folder. In my case, it was located at C:\Program Files\Git\bin .

Finally, run git bash and open some text file in it with nano .

Nano to MSYS

  • mighty work! Thank you! - buyboy