I have a very big web project with lots of pdf, images, php files. I imported files into svn as a single project. I am using svn shallow checkout to checkout part of sub tree, and then use branch, and tag etc from the working copy to save space and speed up checkout time.
I am wondering if this is possible with git. I read that git does not allow you to commit or branch after you do sparse checkout. Is this still true with the newer git releases?
Using the following commands, I was able to check out just the Documentation/ directory from the git repository located at git://github.com/git/git.git:
git init
git remote add -f github-git git://github.com/git/git.git
git config core.sparsecheckout true
echo Documentation/ >> .git/info/sparse-checkout
git pull github-git master
The git documentation doesn't say anything about not being able to commit new changes, so it sounds like it should work fine. Indeed, I tested this and I can confirm that I was able to commit new changes after doing a sparse checkout.
(I'm using git version 1.7.0.4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With