* git clone - not getting the correct default branch
@ 2012-04-18 13:05 Luke Diamand
2012-04-18 13:53 ` Tomas Carnecky
0 siblings, 1 reply; 2+ messages in thread
From: Luke Diamand @ 2012-04-18 13:05 UTC (permalink / raw)
To: Git Users
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.
Both machines are using 1.7.9.4.
Thanks,
Luke
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: git clone - not getting the correct default branch
2012-04-18 13:05 git clone - not getting the correct default branch Luke Diamand
@ 2012-04-18 13:53 ` Tomas Carnecky
0 siblings, 0 replies; 2+ messages in thread
From: Tomas Carnecky @ 2012-04-18 13:53 UTC (permalink / raw)
To: Luke Diamand, Git Users
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-18 13:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-18 13:05 git clone - not getting the correct default branch Luke Diamand
2012-04-18 13:53 ` Tomas Carnecky
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).