How to clone/fetch a repo getting only the history

前端 未结 4 1117
北海茫月
北海茫月 2020-12-17 17:06

Is it possible to download a repository\'s commits, branches, and tags, excluding blobs and trees? I would like to be able to view the history and whatnot without downloadin

4条回答
  •  情话喂你
    2020-12-17 18:03

    The "Partial Clone" feature was added in git 2.19.

    Documentation here: https://www.git-scm.com/docs/partial-clone

    In order to use it:

    • You need git >= 2.19 on both the server and the client
    • On the server, you need to enable the feature: git config --global uploadpack.allowFilter true
    • git clone --filter=tree:0 REMOTE_URL

提交回复
热议问题