如果要创建自定义的git提交模板,可以将路径添加到模板,如下所示:
[commit]
template = ~/.gitmessage但是它一直在我的提交模板默认模板的底部追加:
# 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: lib/test.rb
#在配置上阅读时,它们还附加了默认模板。我知道它被注释掉了,但是无论如何,要删除它,它只显示我的自定义模板?
发布于 2019-05-03 11:08:16
将commit.status设置为false。
git config commit.status false或
git -c commit.status=false commit发布于 2019-05-03 11:19:10
您可以使用git挂钩更改默认模板!
默认情况下,您将有一个名为prepare-commit-msg.sample的git钩子,它为您提供了一些关于什么是可能的概念。您可以通过重命名文件来激活它:
cp .git/hooks/prepare-commit-msg.sample .git/hooks/prepare-commit-msg现在,如果您提交,“默认模板”将消失。请注意,git钩子存储在您的.git/hooks目录中,但是您不能轻松地将它们推送到远程。在吉特书中有很多关于这个主题的信息。
https://stackoverflow.com/questions/55967993
复制相似问题