RE: git rebase -i onto HEAD~n

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

 



>On 2009.02.03 16:22:22 -0000, Bisani, Alok wrote:
>> >And in the editor:
>> >pick HEAD~2
>> >squash HEAD
>> 
>>     # Leave editor for ~/gittest/.git/rebase-merge/git-rebase-todo with
>>     squash 8df4c33 two
>>     # deleted line with discard
>>     squash 91f8267 three
>
>Notice the difference? You're trying to squash 8df4cee into nothing. And _if_ that would work, it would still squash 8df4c33 into the previous commit, which is not what you wanted anyway.

Yes, it is clear now. Thank you. And actually, the help page http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html states this clearly as well: 'If you want to fold two or more commits into one, replace the command "pick" with "squash" for the *second_and_subsequent* commit.'

However, I _did_ want to squash 8df4c33 (HEAD~2) etc, into HEAD~3 (the first commit). But unfortunately I cannot do $ git rebase -i  HEAD~4, as HEAD~3 is the first commit. Although, I understand that it will hardly be ever used in practise.

Is there a way to have git rebase --amend the --onto commit?

Best regards,
Alok

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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