Re: How to change merge message ("weenie commits")
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jan 26, 2007, 12:54 UTC
- Message-ID
- <epctjl$vrv$1@sea.gmane.org>
- In-Reply-To
- <20070125161609.GA7453@diana.vm.bytemark.co.uk>
Karl Hasselström wrote:
Show 9 quoted lines
> On 2007-01-25 09:56:33 -0600, Bill Lear wrote: > >> Do others run into this and perhaps have a good solution? > > I make lots of small commits, then periodically rewrite history with > StGIT to get the nice-looking set of commits I wish I had made in the > first place. I don't think I do anything that couldn't be done with > just git, but StGIT is made precisely for this kind of work, and is > quite good at it.
If you want to use only core git, "git cherry-pick" (with or without --no-commit option), "git commit --amend" and "git merge --squash" (and probably "git rebase --onto") are your friends. You can also do "git format-patch", edit/reorder patches and then "git am --3way" or "git apply".
But StGIT is made for this work. I use it to reorder commits, to amend commit deeper in the history, to split and join commits (although it is more work, at least with version I use). If you have branch which is currently not managed by StGIT, "stg init" and then use "stg uncommit". I frequently use "stg uncommit" and "stg pop"/"stg push" to add commit in the middle of branch.
-- Jakub Narebski Warsaw, Poland ShadeHawk on #git