【发布时间】:2016-01-10 04:48:55
【问题描述】:
有很多答案表明 git 1.9 消除了浅克隆的限制。尽管如此,我使用的是 2.6.1,但仍然存在以下基本问题:
首先,我在某处创建了一个空仓库:
cd /tmp
mkdir target
cd target
git init
然后,我浅克隆一些 repo 并将上述 repo 添加为远程:
cd /tmp
git clone --depth 1 git@github.com:muennich/urxvt-perls.git
cd urxvt-perls
git remote add target /tmp/target
最后,我将这个 repo 推送到远程:
git push target master
然后我得到:
! [remote rejected] master -> master (shallow update not allowed)
error: failed to push some refs to '/tmp/target'
我在这里错过了什么?
【问题讨论】:
-
如果您对 gitlab 感兴趣,请允许此检查 gitlab.com/gitlab-org/gitlab-ce/issues/3033。
标签: git