On 2009-02-09, Brent Goodrick <bgoodr@xxxxxxxxx> wrote: > To explain what I mean: Yesterday, I had this configuration on my > bg/no-progress branch: > > A---B---C---D (bg/no-progress) > / > ----1-----2----3----4 (master) > > B C and D commits are noisy, > fix-the-white-space-and-conform-to-coding-guidelines type commits. I > want to collapse A through D into one commit called E on that branch > so that I can run git format-patch -M on the result and provide a nice > patch email. I would end up with: > > E (bg/no-progress) > / > ----1-----2----3----4 (master) You want to squash the last 4 patches on the current branch into one? The fastest way, if you don't mind re-typing the commit message for the combined commit, is this: git reset --soft HEAD~4 git commit A kinder, gentler, way is this: (1) type in 'git rebase -i HEAD~4' (2) In the editor that pops up, change the 'pick' on all but the first entry to 'squash' or just 's' and save the file. There won't be any conflicts in this scenario, so don't worry about that. (3) Another editor will pop up showing all 4 commit messages in one edit buffer -- combine the various commit messages however you wish and save the file. Done :-) -- Sitaram -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html