bash: nano: command not found at Windows git bash

前端 未结 4 2197
故里飘歌
故里飘歌 2021-02-19 02:34

I am using git version 2.7.0.windows.1 on a windows pc, I used the following command:

$ nano README

which results me:

bash: nan         


        
4条回答
  •  遇见更好的自我
    2021-02-19 03:03

    If anyone's still struggling with this, here's how I managed to get it working.

    1. Download nano-git from https://www.nano-editor.org/dist/win32-support/
    2. Move the exe to (for example) C:\Program Files\Git\bin. I renamed it to nano.exe.
    3. Run nano in bash with winpty nano
    4. Add the following to .gitconfig to make nano your default editor:

    [core] editor = winpty C:/Program Files/Git/bin/nano.exe

    There might be a more elegant solution, but this works for me.

提交回复
热议问题