默认的git提交消息是:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: file1
# modified: file2
#这对我来说很好。但在默认情况下,我更喜欢有一些行没有注释:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
modified: file1
modified: file2
#这样我就不必每次都取消注释了。有可能吗?
谢谢
发布于 2012-03-23 05:34:19
此信息很容易生成。不要在提交消息中包含此信息,因为它所能做的就是与提交中的实际更改不同步。相反,让git生成您稍后需要的信息。例如,git log --name-status将显示哪些文件被修改。您甚至可以在.gitconfig中设置一个alias,将这些选项设为默认值。这种方法可以为您提供所需的所有信息,同时避免可能出现的陷阱和违反git约定的情况。
https://stackoverflow.com/questions/9830769
复制相似问题