Re: how to squash two commits into only one

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

 



On Tue, Mar 29, 2011 at 7:44 PM, Joshua Juran <jjuran@xxxxxxxxx> wrote:
> On Mar 29, 2011, at 3:58 AM, Alex Riesen wrote:
>> On Tue, Mar 29, 2011 at 12:10, Lynn Lin <lynn.xin.lin@xxxxxxxxx> wrote:
>>> On Tue, Mar 29, 2011 at 5:38 PM, Alex Riesen <raa.lkml@xxxxxxxxx> wrote:
>>>> On Tue, Mar 29, 2011 at 07:42, Lynn Lin <lynn.xin.lin@xxxxxxxxx> wrote:
>>>>> ÂI have only have two commits in repo,then I want to squash these
>>>>> two commit into one through git rebase -i .However it fails
>>>>>
>>>>> $ git rebase -i HEAD^1
>>>>> it only show up one commit so can't squash (can't squash without a
>>>>> previous commit)
>>>>
>>>> $ git rebase -i HEAD~2
>>>>
>>> only have two commits
>>
>> Uh. That's unusual.
>>
>> Than yes, "git reset HEAD^; git commit --amend" seems the best solution.
>
> Actually, that should be: Â`git reset --soft HEAD^; git commit --amend`.

"git rebase --root" does not seem a bad idea though. I need to amend
initial commit a few times and end up using "git reset" without
--soft.
-- 
Duy
--
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]