我做过类似的事情:
(1)将远程git存储库克隆到本地主机
本地# git clone http://www.foo.com foo
(2)在ssh主机(bar)上添加另一个项目作为第二个远程存储库
本地# git remote add bar ssh://bar/home/project
本地# git fetch bar
(3)在ssh主机(bar)上做了一些愚蠢的事情:
酒吧# rm -rf /home/project
你能告诉我如何从我的本地副本恢复ssh主机(bar)上的项目,所以ssh主机上的其他开发人员可以继续他们的工作,我可以运行'git fetch bar'来获取他们的提交,就像我没有对他们的ssh主机做任何错误,即撤消我所做的所有主持吧.非常感谢.
更新:
酒吧# mkdir -p /home/project && cd /home/project && git init --bare
本地# git branch remote show bar
本地# git push bar bar/master:refs/heads/master
本地# git push bar bar/branch1:refs/heads/branch1
本地# git push bar bar/branch2:refs/heads/branch2
git ×1