2015-12-14 89 views
2

我使用安裝了記事本++的Windows機器。我使用下面的命令Git關閉編輯器後如何提交?

git config --global core.editor "'C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -nosession" 

然後創建一個新的空白資源庫,並增加了「新建文本文檔.txt」文件中配置編輯器。現在,當我執行「git commit」命令時,它會打開一個帶有文本的新記事本++實例。

# Please enter the commit message for your changes. Lines starting 
# with '#' will be ignored, and an empty message aborts the commit. 
# On branch master 
# 
# Initial commit 
# 
# Changes to be committed: 
# new file: New Text Document.txt 
# 

現在我通過單擊Notepad ++中的保存按鈕保存「COMMIT_EDITMSG」文件並關閉Notepad ++實例。

我的期望是,所有提交都完成了。 但是,如果我運行「git的狀態」命令,它仍然顯示文件不COMMITED

Initial commit 

Changes to be committed: 
    (use "git rm --cached <file>..." to unstage) 

    new file: New Text Document.txt 

還有什麼我需要提交修改呢?

+0

看起來Git並不知道,編輯完成後使用的一個。我建議你使用一個簡單的命令行編輯器來代替這麼龐大的GUI野獸。任何會做。 – arkascha

+0

我使用的命令行編輯器默認由git在Windows 7機器中設置。但它也沒有效果。我可以通過使用「git commit -m'一些消息'」命令來提交。但是我想知道使用編輯器以及如何使用它 – LP13

回答