Re: "git reset --hard" == "git checkout HEAD" == "git reset --hard HEAD" ???

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: "git reset --hard" == "git checkout HEAD" == "git reset --hard HEAD" ???

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:51

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.

Re: "git reset --hard" == "git checkout HEAD" == "git reset --hard HEAD" ???

From: Sitaram Chamarty <hidden>
Date: 2016-06-15 22:45:51

On 2009-01-02, Junio C Hamano [off-list ref] wrote:
chris@seberino.org writes:
quoted
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.
quoted
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...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help