From: Junio C Hamano <gitster@pobox•com>
To: Atsushi Nakagawa <atnak@chejz•com>
Cc: git@vger•kernel.org
Subject: Re: Reset by checkout?
Date: Mon, 02 Jun 2014 14:31:59 -0700 [thread overview]
Message-ID: <xmqqr4372e28.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <xmqqvbsj2e6o.fsf@gitster.dls.corp.google.com> (Junio C. Hamano's message of "Mon, 02 Jun 2014 14:29:19 -0700")
Junio C Hamano <gitster@pobox•com> writes:
> Atsushi Nakagawa <atnak@chejz•com> writes:
>
>> One of the more underrepresented command I use in git use on a regular
>> basis is this "reset by checkout". It's what's currently achieved by
>> this convoluted expression:
>>
>> `git checkout -B <current-branch-name> <tree-ish>`
>>
>> This is such an useful notion that I can fathom why there isn't a better,
>> first-tier, alternative.
>
> Hmph. checkout *is* the first-tier way to do this. Why do you even
> want to do it via "reset"? Is it because you learned "reset" first
> and then learned how "checkout" with various modes all do useful
> things?
Ahh, the "branch to be checked out" being the "current" branch is
indeed strange. That is what "reset --keep" was invented for.
I use "git checkout -B <something-else> <commit>" all the time, and
somehow I thought that was what you were talking about.
Sorry for the noise.
prev parent reply other threads:[~2014-06-02 21:32 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
2014-06-01 4:58 ` Atsushi Nakagawa
2014-06-02 21:29 ` Junio C Hamano
2014-06-02 21:31 ` Junio C Hamano [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=xmqqr4372e28.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=atnak@chejz$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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