git:从备份恢复服务器/远程存储库

发布于 2024-10-28 05:43:07 字数 350 浏览 1 评论 0原文

今天,由于服务器崩溃,我丢失了远程存储库。我安装了 2-3 小时前的备份。不幸的是,我在备份创建后做了一些推送,现在与远程主分支相比,我本地的主分支“不同步”。我的本地主机比远程主机领先了几次提交/推送,现在我不知道该怎么办。我无法再次推送,它显示“![远程拒绝] master -> master(n/a(解包器错误))”。拉也没有帮助。有没有办法让它们干净地恢复“同步”?

否则我会比较两个主机,再次克隆遥控器并应用补丁并再次提交。最大的问题是我所有其他开发人员都需要做同样的事情(因为他们的主分支也不同步),而且我们有很多未推送的本地功能分支。

有什么好的解决方案吗?如果不是,我也必须重新考虑我的备份过程:)

问候, 斯特凡

today i lost my remote repository due to a server crash. i installed a backup which was 2-3 hours old. unfortunately i made some pushed after the backup creation and now the master branch of my local is "out of sync" compared to the remote master branch. my local master is a couple of commits/pushed ahead of the remote master and now i do not know what to do. i can not push again, it says "! [remote rejected] master -> master (n/a (unpacker error))". pulling does not help either. is there a way to get them back "in sync" cleanly?

otherwise i would diff the two masters, clone the remote again and apply the patches and commit again. the biggest problem with that is that all my other developers need to do the same (because their master branches are out of sync as well) and we have a lot of unpushed local feature branches laying around.

any nice solution? if not i have to rethink my backup process as well :)

regards,
stefan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

各空 2024-11-04 05:43:07

您收到的“(解包器错误)”可能表明您的遥控器根本无法正常工作。如果它工作正常,我希望您能够成功地将本地存储库推送到远程。

推送另一个不相关的远程存储库是否有效?如果您遇到相同的错误,则可能是远程计算机上的配置问题,与该特定存储库无关。

The "(unpacker error)" you get may indicate that your remote simply isn't working properly. If it were working properly, I would expect you to be able to push your local repo to the remote successfully.

Does pushing for another unrelated remote repository work? If you get the same error, it's probably a configuration problem on the remote machine, not anything to do with that specific repo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文