Re: Trouble testing out a patch on a branch new scratch git.git repository
- From
Sitaram Chamarty <sitaramc@gmail.com>
- Date
- Feb 10, 2009, 05:32 UTC
- Message-ID
- <slrngp24ap.i22.sitaramc@sitaramc.homelinux.net>
- In-Reply-To
- <e38bce640902091359j3f306839h9aeb699e18e420ab@mail.gmail.com>
On 2009-02-09, Brent Goodrick <bgoodr@gmail.com> wrote:
Show 16 quoted lines
> 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 commitA 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