Is it possible to do a sparse checkout without checking out the whole repository first?

后端 未结 14 1795
醉梦人生
醉梦人生 2020-11-22 09:32

I\'m working with a repository with a very large number of files that takes hours to checkout. I\'m looking into the possibility of whether Git would work well with this kin

14条回答
  •  旧巷少年郎
    2020-11-22 10:17

    Works in git 2.28

    git clone --filter=blob:none --no-checkout --depth 1 --sparse 
    cd 
    git sparse-checkout init --cone
    

    Specify the files and folders you want to clone

    git sparse-checkout add / /
    git checkout
    

提交回复
热议问题