一、 当使用git clone 产生这个问题的时候,在第一次克隆的时候,把克隆深度设置为1,然后再fetch
git clone  https://example.com/example/example.git --depth  1
cd example
git fetch --unshallow

或者,Git小乌龟,克隆时勾选 深度(默认1)。

二、git clone --depth=1 之后怎样获取完整仓库?
  • 1、vim .git/config
    进入编辑模式,输入 i
[remote "origin"]
	url = http://gitlab.pab.com.cn/STB/aims/AIMS-CORE/aims-core.git
	fetch = +refs/heads/master:refs/remotes/origin/master

修改为:
[remote "origin"]
	url = http://gitlab.pab.com.cn/STB/aims/AIMS-CORE/aims-core.git
	fetch = +refs/heads/*:refs/remotes/origin/*

保存退出,按ESC,然后输入 :wq

  • 2、重新拉取
git fetch -v
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐