bash:nano:在Windows git bash中找不到命令 [英] bash: nano: command not found at Windows git bash
问题描述
我在Windows PC上使用git version 2.7.0.windows.1,我使用了以下命令:
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: nano: command not found
现在我怎么能安装nano文本编辑器到git bash?
Now how can I install nano text editor to git bash?
推荐答案
以前的解决方案(@Simopaa) (不含巧克力):
Little modification of the previous solution (@Simopaa) is worked for me on Windows 10 (without Chocolatey):
- 下载 nano-git 移动
nano-git-xxx.exe $ c $ (例如)
C:\ Program Files \Git\bin
。
- Download nano-git
Move the
nano-git-xxx.exe
to (for example)C:\Program Files\Git\bin
.
修改 .gitconfig
文件(单个和双引号非常重要):
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'"
<可选步骤>使 nano
可用于一般编辑:
创建或编辑bash的启动脚本之一(例如〜/ .bash_profile
)与以下内容:
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"
这篇关于bash:nano:在Windows git bash中找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!