Specify commit message with revert --continue

explunit picture explunit · Dec 16, 2014 · Viewed 8.4k times · Source

How can I supply a message with the revert --continue command (i.e. after performing a revert and then resolving conflicts)?

revert --continue tries to pop up a message editor (fails on my system -- different question), but if I try this:

git revert --continue -m "Reverted blah blah and resolved conflicts"

I discover that git revert has a -m parameter for a different purpose.

I don't see any other message-related parameters in the documentation. Is there some common option not listed?

Answer

Raman Zhylich picture Raman Zhylich · Jan 3, 2018

Run git revert --no-commit <SHA> and then git commit -m "<message>"