How to break a series of git commits into patches for submission to another project

Posted by krosenvold on Stack Overflow See other posts from Stack Overflow or by krosenvold
Published on 2010-06-08T18:55:35Z Indexed on 2010/06/09 12:02 UTC
Read the original article Hit count: 273

Filed under:
|

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:

  1. rebase/squash everything to one commit since the old ones often don't make sense as patches
  2. undo that commit
  3. start adding stuff that I think fits to one commit, using add/add -i
  4. commit
  5. stash the rest
  6. test that commit
  7. re-apply the stash and start from 3 until all is accounted for

It works, but is there a better way ?

© Stack Overflow or respective owner

Related posts about git

Related posts about Patches