git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Dani Koretsky'" <Dani@cybereason.com>, <git@vger.kernel.org>
Subject: RE: [BUG]: git checkout on a new tag with current HEAD shows "head detached" at previous tag
Date: Tue, 5 Feb 2019 10:02:09 -0500	[thread overview]
Message-ID: <000c01d4bd63$c8fc7ff0$5af57fd0$@nexbridge.com> (raw)
In-Reply-To: <CANcfovV3Pq3pubtNq4HCSZOJ5OC9dVSm+19VkOiQimAH+fttYw@mail.gmail.com>

On February 5, 2019 4:20, Dani Koretsky wrote:
> I have 2 tags such as release-17.6.230 and release-17.6.220:
> If I'm changing commits, all works as expected.
> 
> If however both are pointing to the same commit, the output is as follows:
> 
> git checkout release-17.6.220
> git status
> HEAD detached at release-17.6.220
> 
> now if I run:
> git checkout release-17.6.230
> git status
> HEAD detached at release-17.6.220
> 
> Which is theoretically correct, but I'd expect after checking out a certain tag
> I'd be see that specific tag...
> 
> Sorry if this is intended behavior, I couldn't find clear mention of this
> behavior on the git checkout documentation online..

Please use

git checkout -b release-17.6.220

What your  commands above have done is resolved release-17.6.220 to a commit, then checked out that commit instead of creating a branch. Alternatively, use

git checkout -b new-branch release-17.6.220

to name it something else.

Regards,
Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.




  reply	other threads:[~2019-02-05 15:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05  9:19 [BUG]: git checkout on a new tag with current HEAD shows "head detached" at previous tag Dani Koretsky
2019-02-05 15:02 ` Randall S. Becker [this message]
2019-02-05 15:16 ` Ævar Arnfjörð Bjarmason
2019-02-05 15:23   ` Ævar Arnfjörð Bjarmason

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='000c01d4bd63$c8fc7ff0$5af57fd0$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=Dani@cybereason.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).