title: git push new file to a bare repo failed: "error: src refspec master does not match any." Why?
body: <p>I was trying this:</p>
  
  <pre><code>mkdir ~/gitremote
  cd ~/gitremote
  git init --bare
  </code></pre>
  
  <p>I can see file names like </p>
  
  <pre><code>HEAD        config      hooks       objects
  branches    description info        refs
  </code></pre>
  
  <p>OK, then in another directory,</p>
  
  <pre><code>git clone trosky@localhost:/Users/trosky/gitremote
  vi readme (add one line)
  git add .
  git commit -m "1st file"
  git push origin master
  </code></pre>
  
  <p>Then it gives an error:</p>
  
  <pre><code>$git push origin master
  error: src refspec master does not match any.
  error: failed to push some refs to 'trosy@localhost:/Users/trosky/gitremote'
  </code></pre>
  
  <p>I searched google and it says this kind of error is due to empty folder on remote repo. But the remote repo is not empty, and locally I'm committing a file that's not empty either. Why this error still prompts out?</p>
  
  <p>How to fix it? Thanks.</p>