On Sunday 07 December 2008, "Li Frank" <Frank.Li@xxxxxxxxxxxxx> 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. ,= ,-_-. =. bss03@xxxxxxxxxxxxxx ((_/)o o(\_)) ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' http://iguanasuicide.org/ \_/
Attachment:
signature.asc
Description: This is a digitally signed message part.