在服务器上(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/'
不确定在初始repo推送时导致此错误的原因。我尝试用一个文本文件创建一个简单的存储库,这很有用。我怀疑可能有一个文件导致错误,但我不确定如何追踪它是哪个文件(除了从repo中删除所有内容并将它们一次添加回来)。
答案 0 :(得分:0)
在空仓库上推新的回购通常需要-u
git push -u origin master