From: Jonathan Nieder <jrnieder@gmail.com>
To: Dun Peal <dunpealer@gmail.com>
Cc: Git ML <git@vger.kernel.org>
Subject: Re: Proper way to checkout a tag?
Date: Wed, 1 Dec 2010 13:51:25 -0600 [thread overview]
Message-ID: <20101201195125.GC27347@burratino> (raw)
In-Reply-To: <AANLkTi=b12n0J+Qg4S7i9dnbMHoWvPS3OXP0CDZevT_4@mail.gmail.com>
Hi,
Dun Peal wrote:
> The problem is that since there's no head pointing to each release, if
> our users just:
>
> $ git checkout release-1
>
> When they want to build that release, they get into a detached HEAD
> state. I've always construed detached HEAD as a non-standard state,
> and it doesn't seem proper to reach it regularly in the course of a
> standard operation like checking out past releases.
>
> It's particularly confusing for our users who are new to Git.
Any ideas for making the detached state more friendly?
The idea is this: when you check out a tag or a remote-tracking
branch, it is not to make changes to it. Tags are unchanging,
remote-tracking branches track remote state that the user does not
directly control. So what does it mean to check out such a thing?
There are two possibilities:
If you are checking out that commit to examine it, test it, maybe
write a few one-off patches, then any work built from there does not
need to be remembered (except in the HEAD reflog, to avoid expensive
accidents). You can make an experiment permanent with
git checkout -b newbranch
If you are starting a new line of development, it needs to get a name.
Long ago this was the only use case supported. Even today it is often
a good way to go:
git checkout -b newbranch release-1
Hope that helps.
Jonathan
next prev parent reply other threads:[~2010-12-01 19:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-01 19:38 Proper way to checkout a tag? Dun Peal
2010-12-01 19:51 ` Jonathan Nieder [this message]
2010-12-01 20:16 ` Dun Peal
2010-12-02 8:33 ` Michael J Gruber
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=20101201195125.GC27347@burratino \
--to=jrnieder@gmail.com \
--cc=dunpealer@gmail.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).