LoopPerfect / buckaroo

The decentralized package manager for C++ and friends 🏝️
https://buckaroo.pm
MIT License
933 stars 33 forks source link

add support for git sparse-checkout #366

Open nikhedonia opened 4 years ago

nikhedonia commented 4 years ago

add support for git sparse-checkout is a new feature that allows partial checkouts of a git repository. This can greatly speedup the download and install phase as we can exclude folders that are not needed. Furthermore this allows also to conveniently split mono-repos into multiple packages.

nikhedonia commented 4 years ago

This is how one can initialize a git repository and fetch just a subset of files:

git clone only one folder:
git init
git remote add origin $GIT_URL
git checkout -b master
git config core.sparsecheckout true
echo include/* >> .git/info/sparse-checkout # inclusion pattern
echo src/* >> .git/info/sparse-checkout # second inclusion pattern
git pull origin master --depth=N  # branch which you want to pull