From: Junio C Hamano <gitster@pobox.com>
To: Michael Witten <mfwitten@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [Improvement?] How do you switch branches in a bare repo?
Date: Sat, 13 Mar 2010 22:52:51 -0800 [thread overview]
Message-ID: <7v7hpfs8cc.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <b4087cc51003120009o7bd99609w996de02b732fbbd9@mail.gmail.com> (Michael Witten's message of "Fri\, 12 Mar 2010 02\:09\:53 -0600")
Michael Witten <mfwitten@gmail.com> writes:
> The "git checkout" command in a bare repository should serve to select
> on which branch other commands (like "git reset") operate, etc.
I am not so sure about the "should" part.
The verb "checkout" is to move/copy something that is stored in somewhere
to some other place, and in the context of git, you are copying out the
contents that is stored in the repository (either the index or the tree of
a commit) to the working tree. It is true that "git checkout branch" also
switches HEAD while doing so, but that is done primarily so that the
result of further working on the checked out files in the working tree
will be recorded in that branch, but I tend to see that as secondary.
"git checkout file" and "git checkout branch file" do not even touch the
HEAD.
I am more interested in the reason why you need to switch HEAD in a bare
repository to begin with, though. If it is a one-shot thing, then I don't
think it is too unreasonable to ask for people to learn symbolic-ref; if
some valid workflow requires to flip the HEAD regularly, on the other
hand, we might want to give the command to do so a shorter-to-type name
than symbolic-ref, and that short name could be "checkout".
prev parent reply other threads:[~2010-03-14 6:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-12 6:26 How do you switch branches in a bare repo? Adam Nielsen
2010-03-12 6:57 ` Johannes Sixt
2010-03-12 7:12 ` Adam Nielsen
2010-03-12 7:34 ` Johannes Sixt
2010-03-12 7:38 ` Adam Nielsen
2010-03-12 8:09 ` [Improvement?] " Michael Witten
2010-03-12 16:48 ` Jonathan Nieder
2010-03-14 6:52 ` 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=7v7hpfs8cc.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mfwitten@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).