Created
September 17, 2013 12:03
-
-
Save werty1st/6593431 to your computer and use it in GitHub Desktop.
git sparse checkout
This file contains hidden or 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
What you are trying to do is called a sparse checkout, and that feature was added in git 1.7.0 (Feb. 2012). The steps to do a sparse clone are as follows: | |
git init <repo> | |
cd <repo> | |
git remote add -f origin <url> | |
This creates an empty repository with your remote. 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 | |
Last but not least, update your empty repo with the state from the remote: | |
git pull origin master | |
damit man später git pull ohne origin master machen kann muss man das noch in ie .git/config eintragen | |
[branch "master"] | |
remote = origin | |
merge = refs/heads/master | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment