There's a remote repository with multiple subdirectories (lib/Android and lib/iOS). Is it possible for me to only subtree in lib/Android?
Yes you can use sparse checkout, which was added in git 1.7.0 .
e.g:
Init repo
mkdir git-subdir
cd git-subdir
git init
Enable Sparse Checkouts
git config core.sparsecheckout true
Tell Git which directories you want
echo "some/dir/" >> .git/info/sparse-checkout
Add the remote
git remote add -f origin https://github.com/git/git.git
Pull
git pull origin master
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