0

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.)

ELLIOTTCABLE
  • 17,185
  • 12
  • 62
  • 78
  • Do you want to *append* another comment line (won't be part of the actual message) or do you want some default text inserted for you as a message stub (will be part of the actual message)? – romainl Oct 02 '14 at 11:19
  • Ah, duplicate indeed. I searched for a while, but couldn't find that. Thanks, Gabriele. – ELLIOTTCABLE Oct 02 '14 at 12:14

0 Answers0