If a git commit fails, the commit message can be recovered from the .git/COMMIT_EDITMSG
file. This file gets overwritten by the last commit message that is attempted. Is there a way to view a failed commit message that was used before the last one?
Not natively with Git. You would have to setup an external process which:
But you would review those past commit messages on your own.
This answer mentions the possibility to reuse past commit message with:
git commit --reuse-message=head@{1}
That isn't exactly what you want (in term of message of "past failed commits", but is the only native git way I know of using past commit messages.
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