初步推送到新的远程git存储库

时间:2015-03-20 15:02:12

标签: git gitlab

我尝试从本地存储库初始推送到Gitlab。本地存储库是从OpenShift克隆的,并且所有更改都已提交并推送。 Gitlab存储库是一个新的存储库。

git remote add gitlab git@gitlab.com:myorg/myproject.git
git push -u gitlab master

我收到此错误

error: object file .git/objects/77/236a32f242ea4e72d54540ac414c798d636d00 is empty
fatal: loose object 77236a32f242ea4e72d54540ac414c798d636d00 (stored in .git/objects/77/236a32f242ea4e72d54540ac414c798d636d00) is corrupt
remote: fatal: early EOF
error: failed to push some refs to 'git@gitlab.com:myorg/myproject.git'

我知道如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

最后,我再次克隆了原始存储库(而不是gitlab)。

然后运行

git remote add gitlab git@gitlab.com:myorg/myproject.git
git push gitlab master 

的工作。

我删除了已损坏的本地仓库,因为所有更改都已提交。