Re: collapsing commits with rebase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/     

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux