title: What is GIT_WORK_TREE, why have I never needed to set this ENV var, why now?
body: <p>I'm using Git under Ubuntu Linux to sync and deploy my projects.</p>
  
  <p>I have a Repo on my local Linux working machine and two repos on my server, one bare repo and the one as a deployed app.</p>
  
  <p>It always worked fine, but now I've created another repo for my other website I get this error:</p>
  
  <pre><code>root@vserver5:/var/www/ninethsky# git pull origin master
  fatal: /usr/lib/git-core/git-pull cannot be used without a working tree.
  </code></pre>
  
  <p>So I have to set a <code>GIT_WORKING_TREE</code> ENV-Var, but what is this exactly, where to set it?</p>
  
  <p>This is my repo's .git/config:</p>
  
  <pre><code>[core]
          repositoryformatversion = 0
          filemode = true
          bare = false
          logallrefupdates = true
  [remote "origin"]
          url = /home/git/ninethsky/.git
          fetch = +refs/heads/*:refs/remotes/origin/*
  </code></pre>
  
  <p>There is another repo with <code>bare = true</code> and a repo on my local working machine.</p>
  
  <p>Then I removed all the repos but the initial one, and now I get:</p>
  
  <pre><code>root@vserver5:/var/www/ninethsky# git init
  fatal: GIT_WORK_TREE (or --work-tree=&lt;directory&gt;) not allowed without specifying GIT_DIR (or --git-dir=&lt;directory&gt;)
  root@vserver5:/var/www/ninethsky# git init --git-dir=/var/www/ninethsky
  error: unknown option `git-dir=/var/www/ninethsky'
  </code></pre>
  
  <p>I solved the <code>git init</code> problem by unsetting GIT_WORK_TREE, which was set to blank.
  <code>GIT_WORK_TREE</code> and <code>GIT_DIR</code> are unset. <code>git init</code> works again, still there is a problem with <code>git add .</code> and so on when it comes to git actions in the cloned repo, which was set to bare.</p>
  
  <p>Thanks,
  Joern.</p>