git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miklos Vajna <vmiklos@frugalware.org>
To: Sitaram Chamarty <sitaramc@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: difference between "git reset --hard" and "git checkout -f"
Date: Wed, 30 Apr 2008 14:16:06 +0200	[thread overview]
Message-ID: <20080430121606.GA23672@genesis.frugalware.org> (raw)
In-Reply-To: <2e24e5b90804300437t39ac16a6ga3cbe0b91d7e5565@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

On Wed, Apr 30, 2008 at 05:07:40PM +0530, Sitaram Chamarty <sitaramc@gmail.com> 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 #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-04-30 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30 11:37 difference between "git reset --hard" and "git checkout -f" Sitaram Chamarty
2008-04-30 12:16 ` Miklos Vajna [this message]
2008-04-30 12:47   ` Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080430121606.GA23672@genesis.frugalware.org \
    --to=vmiklos@frugalware.org \
    --cc=git@vger.kernel.org \
    --cc=sitaramc@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).