如何在不远程存储库中恢复GIT推动-f?

发布于 2025-01-28 14:27:19 字数 416 浏览 3 评论 0原文

本地存储库A(在我系统上a上的分支功能/2.0),我确实与远程存储库B(分支主)相关联的Git Remote

git添加远程存储库B
然后什么都没有改变,直接git push -f将本地存储库a推到远程相关的存储库B,现在关联的远程存储库B被本地存储库A覆盖A content
git push -f全局main
如何还原关联的远程存储库B的内容,我已执行
git reflog - Oneline
git reset - hard< commit-hash>
git push -f onement main
存储库B内容仍然被存储库A覆盖,我想还原存储库B

Local repository A(branch feature/2.0 on A) in my system, i did git remote add associated with a remote repository B (branch main)
git add remote repository B
and then nothing changed, direct git push -f push local repository A to the remote associated repository B, now the associated remote repository B is overwritten by the local repository A content
git push -f global main
how to restore the content of the associated remote repository B,i have executed
git reflog --oneline
git reset --hard <commit-hash>
git push -f origin main
and repository B content is still overwritten by repository A,i want to restore repository B

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

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

发布评论

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

评论(1

酒废 2025-02-04 14:27:19

我回到了旧的本地仓库B,然后尝试git push -f,然后才能强制迫使local to local to local to remotion oild Main Main

i went back to my old local repo B and try git push -f then it works.it will force update local to remote origin main

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