title: Git commit/Push/Pull with sparse checkout
body: <p>I started Git yesterday and before that I was using SVN since many years. Let me explain you what exactly I am trying to achieve:</p>
  
  <p>I have a main git repo for different projects. Something like this:</p>
  
  <ul>
  <li>main_repo/proj1</li>
  <li>main_repo/proj2</li>
  <li>main_repo/proj3</li>
  </ul>
  
  <p>I can't create separate repos for these sub-projects. Now I (or other users) should be able to checkout/commit/push/pull in these independent projects.</p>
  
  <p>For this thing I am trying sparse-checkout with following commands:</p>
  
  <ol>
  <li><code>mkdir proj1; cd proj1</code></li>
  <li><code>git init</code></li>
  <li><code>git remote add origin https://main_repo</code></li>
  <li><code>git config core.sparsecheckout true</code></li>
  <li><code>echo "proj1/" &gt; .git/info/sparse-checkout</code></li>
  <li><code>git pull origin master</code></li>
  </ol>
  
  <p>Now what I need is to get all the files present in proj1 in the same current dir. What I am getting is something like this:</p>
  
  <pre><code>/proj1/proj1/files_and_dirs_in_proj1
  </code></pre>
  
  <p>What I need:</p>
  
  <pre><code>/proj1/files_and_dirs_in_proj1
  </code></pre>
  
  <p>Second this is that the checkout-dir doesn't behaves like a git repo. It doesn't carry any .git dir. So I don't understand how to do commits/push/pull in sparse-checkedout projs.</p>
  
  <p>I hope I explained it well. Please suggest.</p>