兩個問題
- 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++ 文件名