Increase depth of shallow clone without fetching other branches

半城伤御伤魂 提交于 2019-12-08 05:11:21

问题


To save disk space, I generally shallow clone:

  • The latest remote git tag
  • The default branch with:

    git clone --depth 20 --shallow-submodules --recurse-submodules

How do I increase increase the depth of a shallow clone?

Note: I don't want to increase to a full clone, I want to deepen only what I already have.


回答1:


Use git fetch --deepen=<depth>:

man git-fetch says:

  --deepen=<depth>
       Similar to --depth, except it specifies the number of commits from
       the current shallow boundary instead of from the tip of each remote
       branch history.


来源:https://stackoverflow.com/questions/56539456/increase-depth-of-shallow-clone-without-fetching-other-branches

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!