Fwd: Set the repository as it was on an earlier commit

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

 



Ooops I wanted to say Santi answer was the best


---------- Forwarded message ----------
From: Sergio Belkin <sebelk@xxxxxxxxx>
Date: 2009/12/28
Subject: Re: Set the repository as it was on an earlier commit
To: git@xxxxxxxxxxxxxxx


2009/12/26 Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx>:
> Santi Béjar <santi@xxxxxxxxxxx> writes:
>
>> I don't know if it is possible with porcelain commands, but with
>> plumbing you can:
>>
>> # begin with a clean working dir
>> git read-tree B
>> git commit
>> git reset --hard
>
> I guess
>
> (at the root of the repo)
>
> git checkout B -- .
> # git status if you want to check.
> git commit
>
> does this. The "-- ." part of "git checkout" asks Git to checkout the
> files, but the path limiter prevents it from updating HEAD, so the
> HEAD still points to the tip of the branch.
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
>

Sorry but really answer given by Steven was better, because last one
omit the case when B had less files that D for example...

Thanks everyone

--
--
Open Kairos http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
Sergio Belkin -



-- 
--
Open Kairos http://www.sergiobelkin.com
Watch More TV http://sebelk.blogspot.com
Sergio Belkin -
--
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]