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

后端 未结 14 1834
醉梦人生
醉梦人生 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:29

    In my case, I want to skip the Pods folder when cloning the project. I did step by step like below and it works for me. Hope it helps.

    mkdir my_folder
    cd my_folder
    git init
    git remote add origin -f 
    git config core.sparseCheckout true 
    echo '!Pods/*\n/*' > .git/info/sparse-checkout
    git pull origin master
    

    Memo, If you want to skip more folders, just add more line in sparse-checkout file.

提交回复
热议问题