这个git仓库url中冒号的目的是什么? [英] What's the purpose of the colon in this git repository url?

查看:353
本文介绍了这个git仓库url中冒号的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请原谅我的无知;我是Git的新手,不确定在哪里可以找到答案,但是以下URL(指向我的mediatemple服务器上的git存储库)中"example.com"后的冒号的目的是什么?

Please pardon my ignorance; I'm new to Git and not sure where better to look for an answer, but what's the purpose of the colon after 'example.com' in the following url (which points to a git repository on my mediatemple server)?

git remote add repo_name ssh://serveradmin%example.com@example.com:/home/45678/domains/git.example.com/html/example.git

推荐答案

此语法实际上是错误的,但是有点像git URL中可以使用的scp样式语法,该语法将主机名与该主机上的路径. git clone文档中列出了用于指定git URL的选项.在您的情况下,您可能需要以下之一:

This syntax is actually wrong, but it's a bit like the scp-style syntax that you can use in git URLs, where it separates the hostname from the path on that host. Your options for specifying git URLs are listed in the git clone documentation. In your case you probably want one of the following instead:

 serveradmin%example.com@example.com:/home/45678/domains/git.example.com/html/example.git

...或:

 ssh://serveradmin%example.com@example.com/home/45678/domains/git.example.com/html/example.git

无论哪种情况,用户名是serveradmin%example.com,主机名是example.com,该主机上的路径是/home/45678/domains/git.example.com/html/example.git.

In either case, the username is serveradmin%example.com, the hostname is example.com and the path on that host is /home/45678/domains/git.example.com/html/example.git.

这篇关于这个git仓库url中冒号的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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