Subject: Re: Can Git push only first parent history commits?

From: "Boyd Stephen Smith Jr." <[email-masked]>
Date: Sun, 7 Dec 2008 22:03:20 -0600

On Sunday 07 December 2008, "Li Frank" <[email-masked]> wrote 
about 'Can Git push only first parent history commits?':
>        The commit history is:
>        origin/master
>              Commit1..Commit2..Commit3(T1 branch).
>
>        I want to combined Commit1, Commit2 and Commit3 to one commit_X
>and push to origin master and keep old T1 branch history.  So I can't
>use rebase.  T1 branch history will be lost after rebase.

I'm pretty sure you want to do something like this:
git branch T2 T1
git rebase -i master T2
# Editor opens
# Edit commit list to squash 3 commits into 1.
git push origin T2:master
git fetch origin

At the end, you'll have a history that looks like:
*--> origin/master (T2)
 \
  -> C1 --> C2 --> C3 (T1)

I'm not sure why you'd want to do this though.  If the commits don't stand 
alone well, they should be squashed on T1 before pushing.  If the commits 
do stand alone well, the history should preserve them on master as well.
-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
[email-masked]                      ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.org/                      \_/