Archives by Category
Contact
- Hagen Paul Pfeifer
- http://jauu.net
- hagen@jauu.net (encrypted preferred)
- KeyId: 0x98350C22
- Telephone: +49 174 5455209
Follow this blog
Git Interactive Rebase and Stashing
JAN 2012
15
- Published in: programming
- | Time: 21:51:25 CET
- | SHA1: 2e0c05c4b0b59c4874ea937642854b0caae0f4af
Sometimes I have to respin a patch-serie to address some new concerns. This time was a little bit more difficult: I first thought the a new feature can be applied on top of HEAD, later I realized that this particular feature should be applied on a previous commit. The workflow with git is really easy:
# save changes in stash stack git stash # start to rewrite history # change the addressed patch to 'edit' git rebase --interactive HEAD # re-apply the changes git stash pop # eventually fix merge commits vim file-to-fix.c git add file-to-fix.c # recommit git commit --amend # finish rebasing git rebase --continue