git - 如何删除 git commit 默认模板消息?

标签 git git-commit git-config

如果我想创建自定义 git commit 模板,我可以将模板路径添加为:

[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
#

阅读 configuration他们还附加了默认模板。我知道它已被注释掉,但无论如何要删除它以便它只显示我的自定义模板?

最佳答案

commit.status设置为false

git config commit.status false

git -c commit.status=false commit

关于git - 如何删除 git commit 默认模板消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55967993/

相关文章:

Git:如何使用多个存储库?

linux - git --global 开关与一个用户或所有用户相关?

android - 通过 Android versionName 搜索 git 提交

git - 如何获取有效的 git-config 值及其来源?

Git 列出不存在的 Remote

ruby - 连接拒绝来自 Ruby 的 Git

linux - "nothing to commit (working directory clean)"添加文件夹时

git rebase --continue 与新提交

git - 如何删除对 git 的提交

Git 编辑器错误