tags:

views:

23

answers:

2

Git has a bunch of procedures for altering history.
(rebase, filter-branch, commit --ammend, guilt, stacked git, etc)

However, it may sometimes be preferable if there was a procedure to turn the last few commits into a file containing a series of patches with the commit metadata, which could be freely edited, and then turned back into a rebased history (assuming the patches still applied).

Does anyone have a way to do this?

A: 

You could try git format-patch and git am, but that would generate one file per commit though.
You can also use git diff, but that would combine several commits into one patch.

VonC
What's wrong with `git format-patch --stdout`?
Ramkumar Ramachandra
@Ramkumar: good idea, I never tried it and would be interested to see if it works.
VonC
+1  A: 

During your git rebase -i, set the commits you want to change to be edited. Then you can modify them and re-commit with another message all you want.

Daenyth