协议错误:期望的旧/新/参考,得到'浅深的......'

时间:2014-02-04 15:49:56

标签: git

我正在编辑一个使用--depth 1克隆的git存储库(浅层克隆)。

我想推送我的更改(提交),但是我收到了这个错误:

$ git push
Counting objects: 14, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 56.88 KiB | 0 bytes/s, done.
Total 8 (delta 5), reused 0 (delta 0)
fatal: protocol error: expected old/new/ref, got 'shallow deeb2171db739fd366...'
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

我该如何解决这个问题?

正在运行git --version我明白了:

$ git --version
git version 1.9.rc1

1 个答案:

答案 0 :(得分:40)

git fetch --unshallow

另见:how to unshallow your repo