How to break a series of git commits into patches for submission to another project
- by krosenvold
So I've been bashing away at my favorite open source project for quite some time, and It's time for submitting issues with patches back. I have to regroup my commits more or less fully, and hopefully extract some pieces of code that can function as distinct patches to avoid code bombing. Currently I usually do something like this:
rebase/squash everything to one commit since the old ones often don't make sense as patches
undo that commit
start adding stuff that I think fits to one commit, using add/add -i
commit
stash the rest
test that commit
re-apply the stash and start from 3 until all is accounted for
It works, but is there a better way ?