Search code examples
gitgit-commitgit-config

How to remove git commit default template message?


If I want to create a custom git commit template, I can add path to template as:

[commit]
    template = ~/.gitmessage

But it keeps appending at the bottom of my commit template default template:

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

Reading on configuration they also have appended default template. I know it's commented out, but anyway to remove it so it only displays my custom template?


Solution

  • Set commit.status to false.

    git config commit.status false
    

    or

    git -c commit.status=false commit