Show Navigation
Conversation
Notices
-
The number of times I get screwed when signing #Git commits by either entering my smartcard PIN incorrectly or forgetting I changed it... On failure, Git aborts entirely. If you write detailed changelog-style commits like me (which can take a decent amount of time to write), you'll get a heart-sinking feeling when you go to commit again and find that your commit message wasn't retained.
So any time there's a failure, I immediately back up the contents of .git/COMMIT_EDITMSG, where the last message was stored. You will lose it if you try to commit again before this. You can also use `git commit -F .git/COMMIT_EDITMSG`, but note that comment lines aren't removed then, so you'll probably want to edit it before or amend after.
This is something I've been doing since I first learned Git, but hopefully the tip's helpful to someone.