search

Home  >  Q&A  >  body text

github clone has a specified directory under a certain warehouse

How to clone the specified directory under the Github repository. I don’t want to clone the entire directory, I just need to modify a certain directory. How can I do it

淡淡烟草味淡淡烟草味2805 days ago705

reply all(4)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-02 09:29:43

    A warehouse is the only git. git clone is an operation on git and can only be the entire download. git cannot achieve your needs

    reply
    0
  • PHP中文网

    PHP中文网2017-05-02 09:29:43

    // mybranch 指定的仓库名称
    git clone -b mybranch --single-branch git://sub.domain.com/repo.git
    

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-02 09:29:43

    Can achieve:

    mkdir myrepo
    cd myrepo
    git init
    git config core.sparseCheckout true
    git remote add -f origin git://...
    echo path/to/subdir/*> .git/info/sparse-checkout
    git checkout branchname

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-02 09:29:43

    Handling the same as other language clients!
    Window:

    Linux:

    Git:

    reply
    0
  • Cancelreply