title: Git - remote: fatal: You are on a branch yet to be born
body: <p>Im trying to setup a hook to push from my desktop to my server. This has worked countless times in the past but now I'm getting an error upon setting up a new site:</p>
  
  <pre><code>remote: fatal: You are on a branch yet to be born
  </code></pre>
  
  <p>I've done the same series as commands as always, as per <a href="https://github.com/vdecree/a2-hosting-git" rel="noreferrer">this guide</a>.</p>
  
  <p>So on my server I make a git dir. For instance <strong>example.git</strong></p>
  
  <p>I then run <code>git init --bare</code>. After which I go to my hooks:</p>
  
  <pre><code>cd hooks/
  cat &gt; post-receive
  </code></pre>
  
  <p>Inside my post-receive I place:</p>
  
  <pre><code>#!/bin/sh
  git --work-tree=/home/username/public_html/example.com --git-dir=/home/username/example.git checkout -f
  </code></pre>
  
  <p>I Ctrl + D out to save. Then run <code>chmod +x post-receive</code></p>
  
  <p>Then locally I run: <code>git remote add live ssh://username@domain.com:x/home/username/example.git</code></p>
  
  <p>Then I can run: <code>git push -u live master_prefix</code></p>
  
  <p>The only thing I'm doing different is I'm within a branch called master_something, rather than master. Would this be causing the issue and if so, what do I need to do?</p>