简体   繁体   English

如何从虚拟机克隆Git存储库?

[英]How to clone a Git repo from a VM?

I am currently developing inside a virtual Ubuntu box with Git, and I need to clone this repo to another CentOS VM. 我目前正在使用Git在虚拟Ubuntu盒子中进行开发,并且需要将此仓库克隆到另一个CentOS VM。 I don't know how to describe the git repo's location using the user@server:/path.git syntax. 我不知道如何使用user@server:/path.git语法描述git repo的位置。

Anyone can point me to the right direction? 任何人都可以指出我正确的方向吗? Thanks! 谢谢!

Can you ping one VM from the other? 您可以从另一个ping一个虚拟机吗? If so, then the IP you can ping you should be able to ssh to. 如果是这样,那么您可以ping通的IP应该就可以使用SSH了。

If you cannot ping, then perhaps you have a host which is reachable from both VMs. 如果无法ping通,则可能您有一个可以从两个VM都访问到的主机。 You could create a server repo there. 您可以在此处创建服务器存储库。 For instance, github.com or bitbucket.com or the many many others might be a suitable third party host. 例如,github.com或bitbucket.com或许多其他网站可能是合适的第三方主机。 Perhaps you could install a proxy (squid or dante-socks or something similar) to allow the VMs to talk to each other. 也许您可以安装代理(squid或dante-socks或类似的东西)以允许VM相互通信。

If you have email connectivity, perhaps you could mail git-bundles back and forth instead of using normal live git connections. 如果您有电子邮件连接,也许可以来回发送git-bundle而不是使用常规的实时git连接。 There are many ways to do this, but we really need to know more about the networking and communications environment of these Vms to say more. 有很多方法可以做到这一点,但是我们确实需要更多地了解这些Vms的网络和通信环境。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM