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?
Run git revert --no-commit <SHA>
and then git commit -m "<message>"
As an alternative to Raman Zhylich's answer:
git revert <SHA>
git commit --amend -m "<message>"
or if you wanna get real fancy and actually append something to the merge-commit's message.
oldSubject="$(git log -1 --format="%s")"
oldBody="$(git log -1 --format="%b")"
git commit --amend -m "$(echo -e "$oldSubject\n\n$oldBody\n\nfootnote: I'm a good boy.")"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With