'git commit --cleanup = whitespace'做什麼?我試圖測試它,但我無法弄清楚預期的行爲是什麼(它的git文檔只是一行)。 如果我添加它,並有人拉我的代碼,他們會收到一個源代碼與零空白線之間?git commit --cleanup = whitespace是做什麼的?
3
A
回答
3
2
Git 1.9.x/2.0(Q2 2014)將會有另一種替代空白的方法:清理模式「scissors
」。
它是由Nguyễn Thái Ngọc Duy (pclouds
)與commit 75df1f4引入,並且所述new git commit --cleanup
documentation:
scissors
同
whitespace
,不同之處在於一切從(幷包括)行
# ------------------------ >8 ------------------------
如果要編輯的消息將被截斷。
「#
」可以用core.commentChar
定製。
因此,您仍然可以保留評論,並刪除過去某個預定義行的所有內容。
更新七月2015 Git 2.5:現在這個剪刀更加強大。
請參閱commit fbfa097(2015年6月9日)作者:SZEDER Gábor (szeder
)。
已幫助:Junio C Hamano (gitster
)。
(由Junio C Hamano -- gitster
--在commit 07528be合併,2015年6月24日)
「
git commit --cleanup=scissors
」不夠細心保護 對抗,看上去像剪刀線得到上當。
相關問題
- 1. git:使用「commit --cleanup = whitespace」和「rebase --interactive」
- 2. 什麼做「git checkout \ *」和「git commit - 」完成?
- 3. 爲什麼我必須使用「git commit -a」而不是「git commit」?
- 4. 什麼時候需要做「git pull」,在「git add,git commit」之前還是之後?
- 5. git - trim whitespace
- 6. 什麼是「git checkout - 」。做?
- 7. git apply:error trailing whitespace
- 8. 當用戶在「git add」和「git commit」之前做「git push」會發生什麼?
- 9. git cleanup舊分支
- 10. hg commit -u的git相當於什麼?
- 11. git merge origin/master做什麼?
- 12. 忘記「git rebase --continue」並做了「git commit」。怎麼修?
- 13. git commit -m vs git commit -am
- 14. 「git pull remotename -u remotebranchname」是做什麼的?
- 15. 這是做什麼的:git分支-f
- 16. git拉什麼。做?
- 17. git whatchanged - 做什麼?
- 18. 「git commit -vam」完成了什麼?
- 19. git commit的父母是什麼?怎麼可能有多個家長參與git commit?
- 20. git commit的--date參數的格式是什麼
- 21. git commit的做法更好嗎?
- 22. 爲什麼git的pre-commit hook會驗證HEAD是否存在?
- 23. 究竟是什麼意思的commit命令在Git中
- 24. git commit --amend是危險的
- 25. 覆蓋率「cov-trial-cleanup」它做了什麼?
- 26. git add→git commit。這是正確的嗎?
- 27. `git checkout -b新功能主控程序是做什麼的?
- 28. SLOC在git commit
- 29. Aptana 3 git commit
- 30. git commit problems
基於'whitespace',你很快就會有'scissors'清理模式。看到[我的回答如下](http://stackoverflow.com/a/22653722/6309) – VonC