Re: difference between "git reset --hard" and "git checkout -f"

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

 



On Wed, Apr 30, 2008 at 05:07:40PM +0530, Sitaram Chamarty <sitaramc@xxxxxxxxx> wrote:
> I have two questions:
> 
> (1) as in the subject line, what's the difference between these two
> commands?  (I'm talking about those exact commands, not variations).
> I am unable to see any.

git checkout is the tool to check out a branch or paths. git reset is to
reset HEAD (and as a side effect the working directory as well). so i
think only the sematics differ, there is no difference in practice.

> (2) shouldn't one of these have an option to throw away untracked
> files also, to get to a pristine HEAD-eqvt state?  Or is it better to
> force user to use git clean separately for that?

i would say so. we already require (by default) to use git clean -f, as
it may wipe out your work (in case you forgot to git add some important
files), so just adding an other option to perform this dangerous
operation would not be good imho.

Attachment: pgp23bULd1mg5.pgp
Description: PGP signature


[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