且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

浅克隆无法获取新的提交/分支?

更新时间:2023-12-03 21:39:40

正如-depth 的文档所述,

除非给出-no-singlebranch ,否则使用-single-branch

所以如果你想

获取所有分支机构提示附近的历史记录

to fetch the histories near the tips of all branches

在克隆上提供-无单分支,或者一次校正即可自己进行获取,

give --no-single-branch on your clone, or for one-off correction do the fetch yourself,

git fetch --depth=1 origin +refs/heads/*:refs/remotes/origin/*

或追溯关闭单分支设置

git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*

,然后 git fetch .