From: Johannes Sixt <j.sixt@viscovery.net>
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:47:51 +0200 [thread overview]
Message-ID: <48186A77.9040601@viscovery.net> (raw)
In-Reply-To: <20080430121606.GA23672@genesis.frugalware.org>
Miklos Vajna schrieb:
> On Wed, Apr 30, 2008 at 05:07:40PM +0530, Sitaram Chamarty <sitaramc@gmail.com> wrote:
>> (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.
Moreover, if you are in the middle of a merge (e.g. when there are merge
conflicts, or after git merge --no-commit), git reset --hard forgets about
the merge, but git checkout -f does not; hence, a git commit after the
latter would create a merge commit, which is usually not what you want.
-- Hannes
prev parent reply other threads:[~2008-04-30 12:48 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
2008-04-30 12:47 ` Johannes Sixt [this message]
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=48186A77.9040601@viscovery.net \
--to=j.sixt@viscovery.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.