{"thread":{"id":"30276","subject":"git clone - not getting the correct default branch","startedAt":"2012-04-18T13:05:14Z","lastAt":"2012-04-18T13:53:23Z","messageCount":2,"participants":["Luke Diamand","Tomas Carnecky"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"189625","messageId":"CAE5ih7-KmknO8aD=ws-GnUw2RO4fLzscdNYsxkUsFD0Y=28iew@mail.gmail.com","threadId":"30276","inReplyTo":null,"subject":"git clone - not getting the correct default branch","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2012-04-18T13:05:14Z","receivedAt":"2012-04-18T13:05:14Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"A bit weird this.\n\nI have a bare repo (managed with gitolite) which, when I clone it,\nalways comes up with origin/HEAD pointed to origin/master.\n\nThis despite the fact that on the repo, HEAD is a symbolic ref to origin/dev.\n\ni.e.\n\n% git clone git@myserver:myrepo\n...\n% git branch\n* master\n\n% ssh myserver\n% cd /path/to/myrepo.git\n% cat HEAD\nref: refs/heads/dev\n\nWhat could be going wrong? Other repos don't have this problem.\n\nBoth machines are using 1.7.9.4.\n\nThanks,\nLuke\n"},{"id":"189629","messageId":"1334757203-ner-3478@calvin","threadId":"30276","inReplyTo":"CAE5ih7-KmknO8aD=ws-GnUw2RO4fLzscdNYsxkUsFD0Y=28iew@mail.gmail.com","subject":"Re: git clone - not getting the correct default branch","fromName":"Tomas Carnecky","fromEmail":"tomas.carnecky@gmail.com","sentAt":"2012-04-18T13:53:23Z","receivedAt":"2012-04-18T13:53:23Z","isPatch":false,"sender":{"key":"tomas.carnecky@gmail.com","avatar":null},"body":"On Wed, 18 Apr 2012 14:05:14 +0100, Luke Diamand <luke@diamand.org> wrote:\n> A bit weird this.\n> \n> I have a bare repo (managed with gitolite) which, when I clone it,\n> always comes up with origin/HEAD pointed to origin/master.\n> \n> This despite the fact that on the repo, HEAD is a symbolic ref to origin/dev.\n> \n> i.e.\n> \n> % git clone git@myserver:myrepo\n> ...\n> % git branch\n> * master\n> \n> % ssh myserver\n> % cd /path/to/myrepo.git\n> % cat HEAD\n> ref: refs/heads/dev\n> \n> What could be going wrong? Other repos don't have this problem.\n\nDoes master and dev in the repo on the server point to the same commit?\nBecause the git protocol does not expose which *branch* HEAD points to, only\nwhich *commit*. So if two branches point to the same commit, git just takes\nthe first branch and points the local HEAD to that.\n\ntom\n"}]}