title: Git create remote repository on push
body: <p>I have been trying to figure this one out but I am having a hard time doing so. I am currently working on an open source project that requires me to allow a user to <strong>push</strong> to remote repository <strong>without</strong> it already existing there. I want to avoid manually logging in to a server and running <code>git init</code> or <code>git init --bare</code>.</p>
  
  <p>For obvious reasons, I get the following error when trying to push my local repository to a path that doesn't point to an existing repository on the remote server:</p>
  
  <pre><code>fatal: '/var/repositories/myrepo' does not appear to be a git repository
  fatal: The remote end hung up unexpectedly
  </code></pre>
  
  <p>But I would like to be able to run for example the following command:</p>
  
  <pre><code>git push origin master
  </code></pre>
  
  <p>And have that create <code>/myrepo</code> in <code>/var/repositories</code> if it does not yet exist. How would I be able to accomplish this? I would assume it is some kind of <strong>(global) git config</strong> setting you would probably set on the remote server, or otherwise a <strong>(repository specific) git config</strong> locally, but I couldn't figure it out.</p>
  
  <p>Any help would be much appreciated!</p>
  
  <p><strong>Thanks!</strong></p>