github - How does git synchronize the specified directory under the branch
过去多啦不再A梦
过去多啦不再A梦 2017-05-02 09:47:50
0
3
669

On Linux, how to clone a directory under a specified branch through the git command.

For example, the branch name is master, and there are three directories aa, bb, and cc below. I only need to clone the directory aa. Other directories do not need to be cloned locally.

Thank you so much.

过去多啦不再A梦
过去多啦不再A梦

reply all(3)
滿天的星座

Try git subtree http://aoxuis.me/post/2013-08...

Peter_Zhu

sparse checkout

mkdir myrepo
cd myrepo
git init
git config core.sparseCheckout true
git remote add -f origin git://...
echo "path/within_repo/to/desired_subdir/*" > .git/info/sparse-checkout
git checkout [branchname] # ex: master

see http://stackoverflow.com/ques...

Ty80

Versions before 1.7 are not supported. . There is a sparsecheckout configuration item later, which allows you to clone only some files/directories. In fact, all data is still obtained when pulling, but it is filtered when the local warehouse is updated, so the operation is relatively troublesome.
Search sparse-checkout online for specific operations

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template