bash: nano: command not found at Windows git bash

前端 未结 4 2184
故里飘歌
故里飘歌 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

    Little modification of the previous solution (@Simopaa) is worked for me on Windows 10 (without Chocolatey):

    1. Download nano-git
    2. Move the nano-git-xxx.exe to (for example) C:\Program Files\Git\bin.

    3. Modify the .gitconfig file with the following (single and double quotes are important):

      [core]
      editor = "winpty '/c/Program Files/Git/bin/nano-git-0d9a7347243.exe'"
      
    4. (Optional step) Make nano available for editing in general:

      Create or edit the one of the startup script of bash (e.g. ~/.bash_profile) with the followings:

      export PATH="/c/Program Files/Git/bin:$PATH"
      alias nano="winpty nano"
      

提交回复
热议问题