我正在尝试将本地存储库部署到远程目录。我跑过git init --bare
在此远程目录中,并使用 git remote add server ssh://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f386809681b3979c9e929a9ddd909c9e" rel="noreferrer noopener nofollow">[email protected]</a>:2222/path/to/repo
将正确的 ssh 路径添加到我的本地 git repo 分支(名为 dev) .
当我运行git push server dev
时我得到以下输出:
Counting objects: 44, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (37/37), done.
Writing objects: 100% (44/44), 89.58 KiB, done.
Total 44 (delta 2), reused 27 (delta 2)
error: Could not read 551dd5c5d67e3b2da4074d8f15a59a324a063a03
fatal: Failed to traverse parents of commit 0615b940c3247e3547de1379ab09a4a6bb614252
error: Could not read 551dd5c5d67e3b2da4074d8f15a59a324a063a03
fatal: Failed to traverse parents of commit 0615b940c3247e3547de1379ab09a4a6bb614252
To ssh://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="790c0a1c0b391d1614181017571a1614" rel="noreferrer noopener nofollow">[email protected]</a>:2222/path/to/repo
! [remote rejected] dev -> master (missing necessary objects)
error: failed to push some refs to 'ssh://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d6a3a5b3a496b2b9bbb7bfb8f8b5b9bb" rel="noreferrer noopener nofollow">[email protected]</a>:2222/path/to/repo'
我不确定这里发生了什么。
最佳答案
正如“git repository failed to traverse parent error”中提到的,这也可能是由浅克隆引起的。
就您而言(测试存储库),从头开始是最简单的。
总的来说,您在this thread中有有趣的建议:
1. Use "
git rev-list --objects
" to find out what40aaeb204dc
was.And if that doesn't work:
2. Run "
git fsck --full
", with packs intact. This will take a while.
The result would include a list of missing objects (like40aaeb204dc
), and, most importantly, their type.Following howto/recover-corrupted-blob-object.txt would be useful for identifying a corrupt loose object.
关于git - 为什么我的 git 推送到 HostGator 共享主机失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13301748/