如何在致命的文件系统错误后恢复Git? [英] How to restore Git after fatal file system error?

查看:126
本文介绍了如何在致命的文件系统错误后恢复Git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



想象一下,您的OSS项目的中央服务器失败,所有提交恢复后两天都会丢失。你怎么让他们回来?只需在所有客户端上调用git push就足够了吗?或者还有什么我必须考虑的?

解决方案

每个存储库也是主存储库的备份是只有约定的主),所以从做过最近的 git fetch 或者的存储库中创建一个 git push 当然,code> git pull 应该是它所处的状态。你只需要照顾钩子等,但如果你说只有最后两天的提交失败了,那么可能不会受到伤害。


What is the fastest path to restore a git repository after a file system error on the main server?

Imagine the central server of your OSS project fails and all commits for two days are lost after restore. How do you get those back? Is it enough just to call "git push" on all clients? Or is there something else I must take into account?

解决方案

Every repository is also a backup of the "main repository" (which is "main" by convention only) so a git push from the repository that did the most recent git fetch or git pull should be all it takes—up to its state, of course. You only need to take care of the hooks and such but if you say that only the last two days’ worth of commits were lost those were probably not harmed anyway.

这篇关于如何在致命的文件系统错误后恢复Git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆