bash:nano:在Windows git bash中找不到命令 [英] bash: nano: command not found at Windows git bash

查看:937
本文介绍了bash:nano:在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):


  1. 下载 nano-git 移动 nano-git-xxx.exe C:\ Program Files \Git\bin
  1. Download nano-git
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆