title: What is the advantage of using git submodules over having a repo inside another repo with a gitignore?
body: <p>We've been looking into git submodules and we are wondering what advantage (if any) is there in having a repository using submodules verses having a repository within another repository with a .gitignore file.</p>
  
  <p>Example without submodules:</p>
  
  <pre><code>mkdir a
  cd a
  git init
  touch test1.txt
  echo "b" &gt; .gitignore
  git add .
  git commit -m "Adding test1.txt and gitignore"
  
  mkdir b
  cd b
  git init
  touch test2.txt
  git add .
  git commit -m "Adding test2.txt"
  
  git log
  cd ..
  git log
  </code></pre>