title: Get "please make sure that the .gitmodules file is in the working tree" when running the git submodule add command
body: <p>I'm new to git, currently looking at porting some large projects from mercurial.  We have a root project that just contains the references to all the external projects (submodules in git). I'm trying to recreate this in git.</p>
  
  <p>I have imported a project (foo) into githib.  I've created a new empty project (root) and cloned it locally.  I want to add Foo as a submodule using</p>
  
  <pre><code>git submodule add https://github.com/.../foo.git
  </code></pre>
  
  <p>from the /c/Work/GitHub/root (master)</p>
  
  <p>but I keep getting "please make sure that the .gitmodules file is in the working tree".</p>
  
  <p>Looking at the documentation, the first run of this command should create the .gitmodules file, but I get this error even if I create it by hand.  Looking for this error on Google just returns the source files with the error but no explanation to why I'm getting it.  I assume it's just my poor understand of git.</p>
  
  <p>What I'm I doing wrong?</p>
  
  <p>EDIT:
  I've also tried.</p>
  
  <pre><code>mkdir test
  cd test
  git init
  git submodule add https://github.com/.../foo.git
  </code></pre>
  
  <p>I get the same error.</p>