Mar 23, 2009 14:20
Say you're using Subversion upstream, and you have pre-commit hooks to make sure that every commit refers to an open ticket.
In git, you might accidentally commit with a message, "fixes stuff", which was supposed to be "Fixes #45, stuff was broken." If you catch it right away, you can use:
git commit --amend
This will let you fix that commit message, by adding a new commit to the side of the broken one.
If you messed something up earlier, have already merged your changes into the "master" branch, and only now have realised that something is wrong? Hmm… I'm not sure how to fix that one. What I've done is reset the "master" to an old commit before the mistake was made, then play back the patches by hand with an appropriate commit message.
There must be a better way.
git,
programming