两个问题
- git commit中提交描述信息时,以notepad++作为编辑器,也即core.editor;
- 在git bash命令行中直接用notepadd++来编辑文件。
先说第一条的解决方案:
Gitbash中键入:
git config --global core.editor \
"'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
这里要注意的是包围应用程序路径的单引号,以及windows默认的路径分隔符 \ 有转义的含义,所以要改成 / 。
第二条的解决方案也是通过在git bash中添加一个别名notepad++的别名,类似这样,注意事项与第一条相同。
alias notepad++=\
"'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
添加别名的最简单的方法是在git的安装目录下有个etc的文件夹,在bash.bashrc的文件(C:\Program Files\Git\etc\bash.bashrc)最后添加上面那句。
此时,在git bash环境中调用notepad++的方法是
notepad++ 文件名