title: Set Git submodule to shallow clone & sparse checkout?
body: <p>Many vendor Objective-C libraries (e.g., <code>facebook-ios-sdk</code>) instruct you to copy a certain subset of its repo's files/dirs into your Xcode project. One problem with this is then you do not know what revision of the vendor code you have. Another is that if you make changes to the vendor code, it's not easy to contribute your changes via Git.</p>
  
  <p>As a solution, I want to add each vendor library as a Git submodule of my project's repo with some extra settings (say, in the <code>.gitmodules</code> file). This way, if another person clones my project and does <code>git submodule update --init</code>, their repo &amp; submodules will have the same state as mine because they'll be using the same default settings I set:</p>
  
  <ol>
  <li>Sparse checkout: Only check out certain files of the submodule.</li>
  <li>Shallow clone: Only clone a certain SHA1 of the submodule.</li>
  </ol>
  
  <p>How do I set the above settings for a Git submodule?</p>