How to sparsely checkout only one single file from a git repository?

前端 未结 21 2121
Happy的楠姐
Happy的楠姐 2020-11-22 08:14

How do I checkout just one file from a git repo?

21条回答
  •  佛祖请我去吃肉
    2020-11-22 08:47

    You can do it by

    git archive --format=tar --remote=origin HEAD | tar xf -
    git archive --format=tar --remote=origin HEAD  | tar xf -
    

提交回复
热议问题