Specify commit message with return - continue

How can I send a message using the revert --continue (i.e. after performing a return and then resolving conflicts)?

revert --continue trying to output a message editor (a failure on my system is another question), but if I try this:

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

I found that git revert has the -m option for another purpose.

I do not see any other message related parameters in the documentation. Is there a generic option that is not listed?

+6
source share
2 answers

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

+5
source

As an alternative to Raman Zhylych, the answer is:

 git revert <SHA> git commit --amend -m "<message>" 

or if you want to really come up with something and add something to the merge 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.")" 
0
source

Source: https://habr.com/ru/post/979703/


All Articles