git clone - default branch
<p>After cloning a git repository from my gitlab server, it does not checkout master, as origin/HEAD points to some other branch 'origin/foo'. In gitlab, the default branch is set to master.</p>

<p>How can I move origin/HEAD from 'origin/foo' to point to 'origin/master', so that further clones automatically check out origin/master?</p>

<p>Right after cloning, git remote show origin states:</p>

<pre><code>HEAD branch: foo
</code></pre>

<p>git remote -r seconds that:</p>

<pre><code>origin/HEAD -&gt; origin/foo
</code></pre>

<hr>

<p>I want the HEAD branch to point to master, though - inside gitlab - the default branch is already set to master.</p>