git - 为什么我的 git 推送到 HostGator 共享主机失败?

标签 git shared-hosting git-push

我正在尝试将本地存储库部署到远程目录。我跑过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 what 40aaeb204dc 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 (like 40aaeb204dc), 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/

相关文章:

使用来自声明性管道的 jenkins 凭据进行 Git 推送

git - 无法 curl git 标签

git - 从 master 分支更新 develop 分支,而不会丢失 develop 中的任何更改

mysql - 我用于 Wordpress 开发的软件版本是否应该由共享主机上使用的软件版本决定?

git - 无法推送到远程 Git 存储库 - 一切都是最新的

git push --force-with-lease 与 --force

git - 如何在 git 中 merge 两个提交?

Git/Windows - 如何阻止 git 跟踪符号链接(symbolic link)?

git - git pull Godaddy 与 Bluehost 的 shell_exec 配置

php - 如何分发用于共享主机环境的 PHP 扩展