From: Tom Preston-Werner <tom@github.com>
To: git@vger.kernel.org
Subject: Local clone checks out wrong branch based on remote HEAD
Date: Tue, 17 Mar 2009 12:19:35 -0700 [thread overview]
Message-ID: <b97024a40903171219k8841508p774d9dc4295a09bc@mail.gmail.com> (raw)
I'm having some unexpected behavior when cloning a remote repo that
has several branches at the same commit. On the remote side, the HEAD
is 'trunk':
git@remote ~/repositories/akincisor/site.git $ cat HEAD
ref: refs/heads/trunk
After cloning this with a standard `git clone`, the refs are:
[11:48][tom@solid:~/dev/sandbox/site(release)]$ git branch -r -v
origin/HEAD a52528a Fixed some routing problems
origin/release a52528a Fixed some routing problems
origin/trunk a52528a Fixed some routing problems
And the checked out branch is 'release' instead of 'trunk' as I would expect:
[11:48][tom@solid:~/dev/sandbox/site(release)]$ git branch
* release
I'm guessing that the first branch that matches the remote HEAD
revision is being checked out instead of the actual remote branch. I
would expect the correct branch to be chosen regardless of where the
branches are pointing.
Tom
--
Tom Preston-Werner
github.com/mojombo
next reply other threads:[~2009-03-17 19:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-17 19:19 Tom Preston-Werner [this message]
2009-03-17 19:39 ` Local clone checks out wrong branch based on remote HEAD Daniel Barkalow
2009-03-17 23:40 ` Junio C Hamano
2009-03-18 1:51 ` Jeff King
2009-03-17 21:31 ` Nanako Shiraishi
2009-03-18 0:54 ` Jeff King
2009-03-18 10:05 ` Michael J Gruber
2009-03-18 21:11 ` Jay Soffian
2009-03-19 4:04 ` Jeff King
2009-03-19 4:02 ` Jeff King
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=b97024a40903171219k8841508p774d9dc4295a09bc@mail.gmail.com \
--to=tom@github.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).