Questions tagged [commit-message]

The message associated with commits in a version control system.

Questions marked with this tag may be:

  • about style/how to write helpful messages
  • related to automated commit hooks (be sure to include a tag for the version control system you're using)

Related Tags

Useful Links

117 questions
2811
votes
29 answers

How do I make Git use the editor of my choice for commits?

I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git to always use Vim? Note that I want to do this globally, not just for a single project.
brasskazoo
  • 68,343
  • 22
  • 59
  • 74
581
votes
7 answers

Should I use past or present tense in git commit messages?

I read once that git commit messages should be in the imperative present tense, e.g. "Add tests for x". I always find myself using the past tense, e.g. "Added tests for x" though, which feels a lot more natural to me. Here's a recent John Resig…
Skilldrick
  • 65,202
  • 32
  • 168
  • 226
375
votes
9 answers

How to output git log with the first line only?

I am trying to customize the format for git log. I want all commits to be shown in one line. Each line should only show the first line of the commit message. I found out that git log --pretty=short should do the trick but on my computer it shows the…
JJD
  • 44,755
  • 49
  • 183
  • 309
336
votes
12 answers

How to edit incorrect commit message in Mercurial?

I am currently using TortoiseHg (Mercurial) and accidentally committed an incorrect commit message. How do I go about editing this commit message in the repository?
290
votes
8 answers

Print commit message of a given commit in git

I need a plumbing command to print the commit message of one given commit - nothing more, nothing less.
Mark Probst
  • 6,036
  • 5
  • 37
  • 40
153
votes
7 answers

How do I edit an incorrect commit message in git ( that I've pushed )?

I want to modify a commit message deeper in history and I've pushed many new commits. How do I change the commit message? Is it possible?
Jimmy
149
votes
1 answer

When to use "chore" as type of commit message?

What is the use of chore in semantic version control commit messages? Other types like feat or fix are clear, but I don't know when to use "chore". Can anyone provide a couple of examples of its use? Another maybe not related question: What's the…
118
votes
4 answers

Git: How to reuse/retain commit messages after 'git reset'?

As Git user I regular come across the situation, that I need to rework one or more commits in a way which do not fit into --amend or rebase -iwith fixup commits. Typically I would do something like git reset HEAD~1 # hack, fix, hack git commit -a #…
bentolor
  • 2,636
  • 2
  • 18
  • 30
82
votes
4 answers

How to skip the commit message step in "git commit --amend"?

I'm running a very rapid code-compile-test loop where I am amending changes to my commits far more often than not. For example: # Make some changes $ git commit -m "Added feature X" # Compile, test # Fix bugs $ git commit -a --amend I usually want…
nfm
  • 17,148
  • 13
  • 57
  • 88
77
votes
3 answers

Standard to follow when writing git commit messages

I find myself managing very many files (over 60 but below 70) and my commit messages so far follow this pattern: when I have added something like on layout.css, my commit message is "added something on layout.css file", and when I remove something,…
Gandalf
  • 11,766
  • 26
  • 82
  • 146
73
votes
6 answers

How do I prompt the user from within a commit-msg hook?

I want to warn the user if their commit message doesn't follow a certain set of guidelines, and then give them the option to edit their commit message, ignore the warning, or cancel the commit. The problem is that I don't seem to have access to…
Ben Hocking
  • 7,008
  • 4
  • 31
  • 51
73
votes
7 answers

Automatically wrap long Git commit messages in Vim

Using Git, my editor for commits is Vim. I'm constantly doing a poor job of remembering to wrap lines and so I get long lines (see this answer for example). Is there a way using some git config or .vimrc magic that I can get Vim to automatically…
mgilson
  • 264,617
  • 51
  • 541
  • 636
70
votes
2 answers

git pull - can't submit merge message

Possible Duplicate: github locks up mac terminal when using pull command I am using git via the terminal on the mac. I have encountered an annoying problem recently when I try to perform git pull. After performing git pull I receive the following…
Daan
  • 1,443
  • 1
  • 13
  • 12
36
votes
2 answers

Why is it considered good practice to describe git commits in the present tense?

I've read all kinds of Git tutorials, including the official one, and they all seem to tell me it's good convention and practice to write Git commit notes in the present tense. Why is that? What is the reasoning behind it?
Madara's Ghost
  • 158,961
  • 49
  • 244
  • 292
27
votes
4 answers

What to do after typing in commit message for git?

After I type in git commit -a a text editor pops up and I type in my comment. What buttons do I have to press after typing in the comment, to get it to move to the next stage of actually committing? I'm using mysysGit on Windows with the default…
Curyous
  • 8,246
  • 12
  • 54
  • 77
1
2 3 4 5 6 7 8