When entering git commit
, you see something like the following formulaic message in your editor:
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch Master
# Your branch is ahead of 'ec/Master' by 2 commits.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
# modified: package.json
# ...
I'd like to add content to that message visible every time I open the editor (specifically, I often refer to a given project's [.gitlabels][gl] file when writing the first line of the commit message).
Is there any way to do this, or are the specifics of generating that content hard-coded? (If so, is there perhaps a way to have vim
automatically insert content like that when it detects that a git commit-message file is being edited? I'm equally-happy accepting an answer detailing how to do so.)