我弄乱了远程存储库,我可以从本地恢复吗?
我弄乱了我的远程存储库,我可以恢复它吗?
情况:
- 笔记本电脑(从存储库中提取,其中 我从另一台笔记本电脑上推送 错误的数据)
- 桌面(有一个很好的 本地存储库 - 昨天)
桌面
gd@t4q:/var/www/html/t1.org$ git remote show origin
Enter passphrase for key '/home/gd/.ssh/id_rsa':
* remote origin
Fetch URL: git@ip:t1_org.git
Push URL: git@ip:t1_org.git
HEAD branch: master
Remote branches:
develop tracked
master tracked
Local branches configured for 'git pull':
develop merges with remote develop
master merges with remote master
Local refs configured for 'git push':
develop pushes to develop (local out of date)
master pushes to master (up to date)
在桌面上,开发已经过时,由于远程上的信息不同,但错误。
我可以将本地存储库从桌面推送到 git 服务器吗?然后重新应用补丁并将所有内容恢复到我的笔记本电脑上?
如果我确实需要提供更多信息,请告诉我。
TIA, 福西
I've messed up my remote repository, can I restore it?
Situation:
- laptop (pulled form repository where
I pushed from another laptop with
wrong data) - desktop (which has a good
local repository - yesterday)
desktop
gd@t4q:/var/www/html/t1.org$ git remote show origin
Enter passphrase for key '/home/gd/.ssh/id_rsa':
* remote origin
Fetch URL: git@ip:t1_org.git
Push URL: git@ip:t1_org.git
HEAD branch: master
Remote branches:
develop tracked
master tracked
Local branches configured for 'git pull':
develop merges with remote develop
master merges with remote master
Local refs configured for 'git push':
develop pushes to develop (local out of date)
master pushes to master (up to date)
On the desktop, develop is out of date, due information on the remote is different, but wrong.
Can I push local repository from my desktop to my git server? Then reapply patches and pull everything back on my laptop?
If I do need to provide more information, please let me know.
TIA,
Fossie
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 git push -f 从本地(良好)存储库强制覆盖。
You can force an overwrite with
git push -f
from your local (good) repository.