我可以使用git commit -a
來提交一條消息並打開vim進行編輯。但是這個命令會自動提交所有已修改的內容。我真的很想用`git commit -m'來提交。但是這個命令不會調用vim編輯器。如何解決這個問題。git commit -m將不會捲入vim來編輯
-1
A
回答
4
此選項似乎是你要找的:
-e, --edit
The message taken from file with -F, command line with -m, and from
commit object with -C are usually used as the commit log message
unmodified. This option lets you further edit the message taken
from these sources.
+0
你太棒了!你知道我想要什麼 – buzhidao
1
您可以使用git commit
不帶任何參數。它將啓動你的配置文本編輯器(默認是vim),這樣你就可以在那裏輸入提交信息。
+0
第一句話是對的,第二句是不對的,你需要明確地將你的默認編輯器設置爲vim。 – buzhidao
相關問題
- 1. git commit -m vs git commit -am
- 2. git commit -m不工作
- 3. 如何強制「git commit -m」打開編輯器
- 4. git commit -a -m不會添加不固定的文件
- 5. 使用git commit -a和vim
- 6. Git-commit無法打開vim
- 7. Git rebase和Vim編輯器
- 8. ^在Git commit消息中的M個字符(git commit -v)
- 9. 瞭解何時使用git commit -m和git commit -am
- 10. Git編輯器在提交vim時
- 11. 編輯git commit消息時自動進入插入模式
- 12. 配置git commit編輯器顏色
- 13. 如何編輯以前的git commit?
- 14. 當我輸入git commit -m「My message」時出現錯誤
- 15. git commit不會提交新文件
- 16. git commit -am和git之間有什麼區別-m
- 17. git commit -a與-a -m有什麼不同?
- 18. (git add -A後跟git commit)和git commit -a之間的區別?
- 19. ^M顯示在git diff中,但不是vi編輯器
- 20. Git commit patches
- 21. Git revert lastet commit
- 22. Git打開默認的git編輯器而不是VIM或任何其他編輯器(Git Rebase)
- 23. git commit to all branches
- 24. 「git commit --amend -c <commit>」不保存更改
- 25. Git commit bash腳本
- 26. git commit -amend without ask for message
- 27. 輸入「git commit」時出錯?
- 28. VIM宏編輯
- 29. NSTextField commit編輯綁定
- 30. 結合git add。和git commit
所以你想運行'git commit -m「my message」',讓編輯器打開,並且已將「my message」添加到提交消息中? – chepner
@chepner是的,我想更仔細地編輯此消息。 – buzhidao
所以,只需輸入'git commit'而無任何參數? – 1615903