github - git如何同步分支下指定的目录
过去多啦不再A梦
过去多啦不再A梦 2017-05-02 09:47:50
0
3
595

在linux上,如何通过git命令clone指定分支下的某个目录。

比如分支名称为master,下面有aa,bb,cc三个目录,我只需要clone aa这个目录。其他的目录不需要克隆到本地。

感激不尽。

过去多啦不再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
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!