title: How do I make git ignore the .git folders under vendor/?
body: <p>I am using composer, and for development I want to keep the .git folders in the vendor directory, so I can track diffs, etc.  So my project structure is:</p>
  
  <pre><code>projectroot/
    .gitignore
    file1
    file2
    vendor/
      dir1/
        module1/
          .git/
          module1file1
          module1file2
          ...
      dir2/
        module2/
          .git/
          module2file1
          ...
  </code></pre>
  
  <p>I would like to commit to git, these files:</p>
  
  <pre><code>file1
  file2
  vendor/dir1/module1/module1file1        
  vendor/dir1/module1/module1file2    
  vendor/dir2/module2/module2file1        
  ...
  </code></pre>
  
  <p>What should my projectroot/.gitignore file be?  From <a href="https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md" rel="nofollow">the composer docs</a> I tried</p>
  
  <pre><code>vendor/*.git
  </code></pre>
  
  <p>and </p>
  
  <pre><code>vendor/*/.git
  </code></pre>
  
  <p>but in both cases, git 1.8.3 still wants to commit <code>vendor/dir1/module1</code> and <code>vendor/dir2/module2</code> as submodules, where I want to commit the files underneath instead.</p>
  
  <p>What should the .gitignore syntax be in that case?</p>