Skip to content

Instantly share code, notes, and snippets.

@brandedoutcast
Created October 15, 2015 18:53
Show Gist options
  • Save brandedoutcast/3a2e18eb2185ef2b5465 to your computer and use it in GitHub Desktop.
Save brandedoutcast/3a2e18eb2185ef2b5465 to your computer and use it in GitHub Desktop.
How to do a sparse checkout in git
mkdir [RepoName]
git init
cd [RepoName]
git remote add -f origin [RepoURL]
git config core.sparseCheckout true
echo "some/dir/*" >> .git/info/sparse-checkout
echo "another/sub/tree/*" >> .git/info/sparse-checkout
git checkout master
or
git pull origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment