How to convert a Git shallow clone to a full clone?
后续的这个问题:如果我有一个浅层克隆,如何获取所有较旧的提交以使其成为完整的克隆?
你可以运行git fetch --depth=1000000
(假定版本库的提交少于100万次)。
The below command (git version 1.8.3) will convert the shallow clone to regular one
git fetch --unshallow
Then, to get access to all the branches on origin (thanks @Peter in the comments)
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin
I needed to deepen a repo only down to a particular commit.
After reading man git-fetch
, I found out that one cannot specify a commit, but can specify a date:
git fetch --shallow-since=15/11/2012
For those who need incremental deepening, another man
quote:
--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.
链接地址: http://www.djcxy.com/p/90446.html上一篇: 从远程Git存储库中检索特定的提交
下一篇: 如何将Git浅层克隆转换为完整克隆?