Last active
July 19, 2016 18:40
-
-
Save delputnam/058ae65a52d3d6a00d09a75078c98ce6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir <repo> | |
cd <repo> | |
git init | |
git remote add -f origin <url> | |
# This creates an empty repository with your remote, and fetches all objects | |
# but doesn't check them out. | |
# Then do: | |
git config core.sparseCheckout true | |
# Now you need to define which files/folders you want to actually check out. | |
# This is done by listing them in .git/info/sparse-checkout, eg: | |
echo "some/dir/" >> .git/info/sparse-checkout | |
echo "another/sub/tree" >> .git/info/sparse-checkout | |
# Update your empty repo with the state from the remote: | |
git pull origin master | |
# If you don't need the history, use: | |
git pull --depth=1 origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment