git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <mattr94@gmail.com>
To: "'Tomas Zubiri'" <me@tomaszubiri.com>, <git@vger.kernel.org>
Subject: RE: Head, Branch != Head -> Branch?
Date: Sat, 14 Dec 2019 17:41:49 -0500	[thread overview]
Message-ID: <007401d5b2cf$ac787ed0$05697c70$@gmail.com> (raw)
In-Reply-To: <CAE3VKEppVv=rocJU7jHKu7i=dLyaHhpauTBmm91udjZ_DOpW+g@mail.gmail.com>


After going through the code and thinking about this. I think the unexpected results came from git branch not checking out the branch I created.
I know git checkout -b master would have been the result I wanted. If I were to create another commit with HEAD checked out instead of master, master would not update, only HEAD would.
> I guess the real crime here is that git branch does not checkout the branch created. I don't think I ever wanted to create a branch without checking it out, otherwise I would use git tag.

The problem with this is that git tag doesn't create a new branch, but rather just a new tag so running something like:

git tag my-tag
git checkout my-tag
git add .
git commit -m "message"

wouldn't update my-tag either, you would need to create a new branch for that.  Sometimes I want to create a branch without checking it out, as I'm sure many other users do.  Is it an issue of documentation where maybe the behavior isn't clear? It does specifically say this in the description of git branch, but to be fair it is buried 6 paragraphs in


  reply	other threads:[~2019-12-14 22:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 18:00 Head, Branch != Head -> Branch? Tomas Zubiri
2019-12-14 21:56 ` Tomas Zubiri
2019-12-14 22:41   ` mattr94 [this message]
2019-12-15  3:32     ` Tomas Zubiri
     [not found]       ` <CAPYjA5YsLyeZvimsUqJpcyNCybVFK2+mKRskjQ79OKJHffdSLg@mail.gmail.com>
2019-12-15  5:36         ` Joshua Teves

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='007401d5b2cf$ac787ed0$05697c70$@gmail.com' \
    --to=mattr94@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@tomaszubiri.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).