buckaroo icon indicating copy to clipboard operation
buckaroo copied to clipboard

add support for git sparse-checkout

Open nikhedonia opened this issue 5 years ago • 1 comments

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 avatar Jan 19 '20 13:01 nikhedonia

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

nikhedonia avatar Apr 13 '20 22:04 nikhedonia