git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomas Carnecky <tomas.carnecky@gmail.com>
To: Luke Diamand <luke@diamand.org>, Git Users <git@vger.kernel.org>
Subject: Re: git clone - not getting the correct default branch
Date: Wed, 18 Apr 2012 13:53:23 +0000	[thread overview]
Message-ID: <1334757203-ner-3478@calvin> (raw)
In-Reply-To: <CAE5ih7-KmknO8aD=ws-GnUw2RO4fLzscdNYsxkUsFD0Y=28iew@mail.gmail.com>

On Wed, 18 Apr 2012 14:05:14 +0100, Luke Diamand <luke@diamand.org> wrote:
> A bit weird this.
> 
> I have a bare repo (managed with gitolite) which, when I clone it,
> always comes up with origin/HEAD pointed to origin/master.
> 
> This despite the fact that on the repo, HEAD is a symbolic ref to origin/dev.
> 
> i.e.
> 
> % git clone git@myserver:myrepo
> ...
> % git branch
> * master
> 
> % ssh myserver
> % cd /path/to/myrepo.git
> % cat HEAD
> ref: refs/heads/dev
> 
> What could be going wrong? Other repos don't have this problem.

Does master and dev in the repo on the server point to the same commit?
Because the git protocol does not expose which *branch* HEAD points to, only
which *commit*. So if two branches point to the same commit, git just takes
the first branch and points the local HEAD to that.

tom

      reply	other threads:[~2012-04-18 13:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 13:05 git clone - not getting the correct default branch Luke Diamand
2012-04-18 13:53 ` Tomas Carnecky [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=1334757203-ner-3478@calvin \
    --to=tomas.carnecky@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=luke@diamand.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).