How to amend a commit without changing commit message (reusing the previous one)?

Sridhar Sarnobat picture Sridhar Sarnobat · Apr 19, 2012 · Viewed 156.3k times · Source

Is there a way to amend a commit without vi (or your $EDITOR) popping up with the option to modify your commit message, but simply reusing the previous message?

Answer

Shaggie picture Shaggie · Apr 28, 2012

Since git 1.7.9 version you can also use git commit --amend --no-edit to get your result.

Note that this will not include metadata from the other commit such as the timestamp which may or may not be important to you.