title: How to commit Composer vendor folder into Git repository?
body: <p><strong>Can I setup <code>.gitignore</code> in such a way to allow Composer dependencies (the vendor directory) to live inside my repository?</strong></p>
  
  <p>Composers officially recommends that you "should not" do this. And it provides three reasons (<a href="https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md" rel="noreferrer">https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md</a>):</p>
  
  <ol>
  <li>Large VCS repository size and diffs when you update code.</li>
  <li>Duplication of the history of all your dependencies in your own VCS.</li>
  <li>Adding dependencies installed via git to a git repo will show them as submodules. This is problematic because they are not real submodules, and you will run into issues.</li>
  </ol>
  
  <p>All these three reasons do not matter to me. Also it may be possible that reason three could be obviated by a clever <code>.gitignore</code>.</p>
  
  <p>If it is necessary for me to state a motivation for this question then my motivation is: CocoaPods does it this way and I like how CocoaPods works.</p>
  
  <p>What exactly should I do in <code>.gitignore</code> to achieve this?</p>