Re: "git reset --hard" == "git checkout HEAD" == "git reset --hard HEAD" ???
- From
Sitaram Chamarty <sitaramc@gmail.com>
- Date
- Jan 3, 2009, 06:02 UTC
- Message-ID
- <slrngltvrd.63u.sitaramc@sitaramc.homelinux.net>
- In-Reply-To
- <7v4p0hcp3w.fsf@gitster.siamese.dyndns.org>
On 2009-01-02, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> chris@seberino.org writes: > >> Does "git reset --hard" == "git checkout HEAD" == "git reset --hard HEAD" ??? > > No, but "reset --hard" without a commit-ish defaults to HEAD so the first > one and the last one are equivalent. > >> It seems we have 2 ways to blow away work we haven't >> checked in yet then right? > > Wrong.
Strictly as asked, yes, but what if he adds a "-f" to the middle command, making it "git checkout -f HEAD"? Wouldn't that be the same as the others then?
I always thought they were eqvt...