title: Submodule folders visible in past commitments
body: <p>I am testing git for the first time to check whether it can be a solution for my version control problem. I started playing with submodules and I noticed an unexpected behaviour.</p>
  
  <p>Useful information:</p>
  
  <ul>
  <li>I am running git on OS</li>
  <li>My remote repository is on Bitbucket</li>
  <li>I work with terminal and check things with Sourcetree</li>
  </ul>
  
  <p>This is the tree from Sourcetree:</p>
  
  <p><a href="https://i.stack.imgur.com/5m7zR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5m7zR.png" alt="enter image description here"></a></p>
  
  <p>The submodule "library" was added in the fourth commitment "I have a library now".</p>
  
  <p>When I <code>git checkout master</code>, I see my repository correctly, with my ProjectFile.txt and my submodule "library":</p>
  
  <p><a href="https://i.stack.imgur.com/LoA4F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LoA4F.png" alt="enter image description here"></a></p>
  
  <p>I would expect to find only a readme file if I <code>git checkout &lt;hash 1st commitment&gt;</code>, but this is not the case. The .gitmodules disappears but the "library" folder with its content is still there:</p>
  
  <p><a href="https://i.stack.imgur.com/JvEHu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JvEHu.png" alt="enter image description here"></a></p>
  
  <p>If I go to my remote repository on Bitbucket and I checkout the same 1st commitment then I find no library folder as expected:</p>
  
  <p><a href="https://i.stack.imgur.com/04Zs8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/04Zs8.png" alt="enter image description here"></a></p>
  
  <p>Why is the "library" folder popping up before it was actually added on my computer?</p>
  
  <p>Notice that the "library" folder could not be there by mistake as the first commitment is present by default when a new repository on Bitbucket is created.</p>