如何连接到远程Git存储库? [英] How to connect to a remote Git repository?

查看:125
本文介绍了如何连接到远程Git存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与一个团队合作,我们想使用Git(不适用于GitHub,我们有一个专用的远程计算机).到目前为止,我们一直在使用SVN. 我们有一台类似于SVN信息库的远程机器. 现在,我们要将这台机器放入Git中央存储库. 据我所读,每个人都需要在自己的计算机上做的事情是安装Git并使用以下命令添加远程主存储库:

I am working with a team and we want to use Git (Not with GitHub, we have a private remote machine). We were using SVN until now. We have a remote machine that works like an SVN repository. Now, we want to make this machine into the Git central repository. By what I have read, what everyone needs to do on their machines, is to install Git and use the following command to add the remote master repository:

git remote add origin <remote_repo_url>

但是remote_repo_url是什么?我该如何解决? 我的远程计算机在我安装了Git的远程计算机中具有类似189.14.666.666的IP,并在C:\ MY_GIT_REPOSITORY下创建了一个存储库.我应该在本地计算机的URL中输入什么?

But what is the remote_repo_url? How can I figure it out? Our remote machine have IPs like 189.14.666.666, in the remote machine I've installed Git and created a repository under C:\MY_GIT_REPOSITORY. What should I put in the URL in the local machines?

推荐答案

现在,如果存储库已存在于远程计算机上,而您在本地没有任何存储库,则改为进行git clone.

Now, if the repository is already existing on a remote machine, and you do not have anything locally, you do git clone instead.

URL格式很简单,它是PROTOCOL:/[user @] remoteMachineAddress/path/to/repository.git

The URL format is simple, it is PROTOCOL:/[user@]remoteMachineAddress/path/to/repository.git

例如,使用"dev"用户在您具有SSH访问权限的计算机上克隆一个存储库,该存储库位于/srv/repositories/awesomeproject.git中,并且该计算机具有您执行的ip 10.11.12.13:

For example, cloning a repository on a machine to which you have SSH access using the "dev" user, residing in /srv/repositories/awesomeproject.git and that machine has the ip 10.11.12.13 you do:

git clone ssh://dev@10.11.12.13/srv/repositories/awesomeproject.git

这篇关于如何连接到远程Git存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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