1

在服务器上 (site@site)

> git init --bare

回到我的客户

> git remote add origin site@site:/home/git/repos/repo_name/

> git push origin master 

Counting objects: 43, done.
Delta compression using up to 2 threads.
fatal: git upload-pack: protocol error, expected to get sha, not '0000000000000000000000000000000000000000 f9b6ddffc38fe0cfcd0ab311197bb31d1fab4856 refs/heads/master'
Compressing objects: 100% (42/42), done.
error: pack-objects died of signal 13
error: failed to push some refs to 'site@site:/home/git/repos/repo_name/'

不确定是什么导致初始回购推送时出现此错误。我尝试用一​​个文本文件创建一个简单的存储库,并且成功了。我怀疑可能有一个文件导致了错误,但不确定如何追踪它是哪个文件(除了从存储库中删除所有内容并一次将它们添加回来)。

4

1 回答 1

0

在空仓库上推送新仓库通常需要 -u

git push -u origin master
于 2013-02-06T19:25:15.673 回答