git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: chris@seberino.org
Cc: git@vger.kernel.org
Subject: Re: git reset --hard <commit> superfluous?
Date: Sat, 3 Jan 2009 13:20:01 +0100	[thread overview]
Message-ID: <20090103122001.GA20199@atjola.homenet> (raw)
In-Reply-To: <20090103011319.GA24149@seberino.org>

On 2009.01.02 17:13:19 -0800, chris@seberino.org wrote:
> David
> 
> git reset --hard <commit>
> "resets" the current branch head.
> 
> Is this equivalent to deleting the branch
> and doing
> 
> git branch <branch> <commit> ??
> 
> So "git reset --hard" is syntactic sugar and 'unnecessary' right?

Deleting the branch also deletes the reflog, while using reset adds a
new entry to the reflog. So returning the branch head to its previous
state is pretty trivial if you used reset and might be pretty hard if
you deleted the branch. HEAD's reflog should probably have the right
entry as well, but chances are that it's hidden in a crapload of other
entries, especially if you rebase often.

Björn

      parent reply	other threads:[~2009-01-03 12:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-03  1:13 git reset --hard <commit> superfluous? chris
2009-01-03  6:34 ` Sitaram Chamarty
2009-01-03 12:20 ` Björn Steinbrink [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=20090103122001.GA20199@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=chris@seberino.org \
    --cc=git@vger.kernel.org \
    /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).