title: Issue with adding common code as git submodule: "already exists in the index"
body: <p>I'm new to git and would appreciate help with adding submodules.
  I've received two projects sharing some common code. The shared code was just copied into the two projects. I created a separate git repo for the common code and removed it from the projects with the plan to add it as a <code>git</code> submodule.</p>
  <p>I used the path option of git submodule add to specify the folder:</p>
  <pre><code>git submodule add url_to_repo projectfolder
  </code></pre>
  <p>but then got the error:</p>
  <pre><code>'projectfolder' already exists in the index&quot;
  </code></pre>
  <p>This is the desired structure of my repository:</p>
  <pre><code>repo
  |-- projectfolder
      |-- folder with common code
  </code></pre>
  <p>It is possible to add the <code>git</code> submodule directly in the repo, or into a new folder there, but not in the project folder. The problem is that it really need to be in the project folder..
  What can I do about this and what have I misunderstood about the path option of git submodule add?</p>