title: Procedure for cloning Git repos that use subtree
body: <p>I'm using Git's subtree command to pull a couple of libraries in to a project. </p>
  
  <p>If I then clone the project in the normal way, I end up with all the code that I need, but I lose the subtree relationships - in the clone there is no remote for each of the libraries, and there is no -push branch for either of them.</p>
  
  <p>What's the best way to re-establish this connection? </p>
  
  <p>Is it sufficient to do </p>
  
  <pre><code>git remote add &lt;lib&gt; &lt;remote-url&gt;
  git fetch &lt;lib&gt;
  </code></pre>
  
  <p>If I was adding the library for the first time I'd follow that with:</p>
  
  <pre><code>git subtree add -P &lt;local/lib&gt; --squash "&lt;lib&gt;/master"
  </code></pre>
  
  <p>This doesn't work when the local directory already exists though, which of course it will when you've cloned a project that has already had the library added to it.</p>
  
  <p>Is there anything else that one should do in this situation, to ensure that subsequent git subtree merge and git subtree split commands to the expected thing?</p>