title: Git - push failure / This operation must be run in a work tree
body: <p>I'm following the Git Pro book ( <a href="http://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server" rel="nofollow">http://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server</a> ) to set up my first git remote server on Ubuntu.
  After I follow this:</p>
  
  <pre><code>$ git remote add origin git@gitserver:/opt/git/inventory.git
  $ git push origin Windows
  </code></pre>
  
  <p>I receive this message:</p>
  
  <pre><code>Counting objects: 33, done.
  Delta compression using up to 4 threads.
  Compressing objects: 100% (28,28) done.
  Writing objects: 100% (33/33), 7.30 KiB | 0 bytes/s, done.
  Total 33 (delta 13), reused 0 (delta 0)
  To git@gitserver:/opt/git/inventory.git
   * [new branch]    Windows -&gt; Windows
  </code></pre>
  
  <p>But when I type <code>git status</code>on the remote server (in /opt/git/inventory.git/) I get the error message <code>fatal: This operation must be run in a work tree</code></p>
  
  <p>The remote repository appears to not contain any of the files from the local repository and when I clone the remote repository into a different local folder there are no files, just the .git folder.</p>
  
  <p>I have looked at other related questions on here:</p>
  
  <p><a href="https://stackoverflow.com/questions/9262801/fatal-this-operation-must-be-run-in-a-work-tree">fatal: This operation must be run in a work tree</a></p>
  
  <p><a href="https://stackoverflow.com/questions/1456923/why-am-i-getting-the-message-fatal-this-operation-must-be-run-in-a-work-tree">Why am I getting the message, &quot;fatal: This operation must be run in a work tree?&quot;</a></p>
  
  <p><a href="https://stackoverflow.com/questions/11931840/getting-fatal-this-operation-must-be-run-in-a-work-tree-on-bare-repository">Getting “fatal: This operation must be run in a work tree?” on bare repository</a></p>
  
  <p>but am no clearer as to why this is happening and what i can do to remedy it.</p>