git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Felipe Contreras <felipe.contreras@gmail.com>,
	Atsushi Nakagawa <atnak@chejz.com>,
	git@vger.kernel.org
Subject: RE: Reset by checkout?
Date: Sat, 31 May 2014 18:39:24 -0500	[thread overview]
Message-ID: <538a682c9540f_140996b2fc71@nysa.notmuch> (raw)
In-Reply-To: <5389b57138645_68b153b2f8a5@nysa.notmuch>

Felipe Contreras wrote:
> Atsushi Nakagawa wrote:
> > Ok, the typical use case is: I'm on 'master' and I make a few test
> > commits.  Afterwards, I want to discard the commits and move back to
> > 'origin/master'.  I could type 'reset --hard origin/master' and risk
> > blowing away dirty files if I'm not careful.  Or, I could use "reset by
> > checkout" and be carefree.
> 
> Doesn't 'git reset orign/master' do that?

Unless you want to keep the staged files, in which case adding the
--stage and --work options I originally suggested[1] would help.

So you could do `git reset --no-stage --no-work origin/master`

Which is essentially the same as `git update-ref refs/heads/master
origin/master`.

[1] http://article.gmane.org/gmane.comp.version-control.git/247086

-- 
Felipe Contreras

  reply	other threads:[~2014-05-31 23:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-31  5:46 Reset by checkout? Atsushi Nakagawa
2014-05-31  7:03 ` Andreas Schwab
2014-06-01  2:56   ` Atsushi Nakagawa
2014-05-31  7:27 ` Kevin Bracey
2014-06-01  4:26   ` Atsushi Nakagawa
2014-06-01  8:45     ` Kevin Bracey
2014-06-02 21:54       ` Junio C Hamano
2014-06-03 19:48         ` Kevin Bracey
2014-06-03 21:48           ` Felipe Contreras
2014-06-07  4:54       ` Atsushi Nakagawa
2014-06-07 14:52         ` Philip Oakley
2014-06-09 20:12           ` Kevin Bracey
2014-06-07  4:55     ` Atsushi Nakagawa
2014-05-31 10:56 ` Felipe Contreras
2014-05-31 23:39   ` Felipe Contreras [this message]
2014-06-01  4:58     ` Atsushi Nakagawa
2014-06-02 21:29 ` Junio C Hamano
2014-06-02 21:31   ` Junio C Hamano

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=538a682c9540f_140996b2fc71@nysa.notmuch \
    --to=felipe.contreras@gmail.com \
    --cc=atnak@chejz.com \
    --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).