Re: collapsing commits with rebase
- From
Boyd Stephen Smith Jr. <bss@iguanasuicide.net>
- Date
- Jan 8, 2009, 02:11 UTC
- Message-ID
- <200901072011.37299.bss@iguanasuicide.net>
- In-Reply-To
- <93c3eada0901071608r190a723bma502b68c4ab81a08@mail.gmail.com>
On Wednesday 2009 January 07 18:08:44 Geoff Russell wrote:
>I have a series of commits: > > A---B---C---D---E---F
Assuming you also have a ref (e.g. Foo) that points to F: git checkout sha(B) git merge -s sha(D) git rebase --onto $(cat .git/HEAD) sha(E) Foo
should do what you want.
After the checkout: A -> B [HEAD] -> C -> D -> E -> F [Foo] (detached HEAD)
After the merge:
A -> B -> C -> D -> E -> F [Foo]
|
+--> [HEAD]
(detached HEAD)After the rebase:
A -> B -> E' -> F' [Foo, HEAD]
|
+--> C -> D -> E -> F
(C, D, E, and F will be pruned at some point)-- Boyd Stephen Smith Jr. ,= ,-_-. =. bss@iguanasuicide.net ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.net/ \_/