5

好的。所以我的网站托管在 InmotionHosting 上。这是一个共享服务器,所以 ssh 出来了。我一直在通过 FTPS 访问它。我在工作中使用 git,所以我很想开始在我的个人网站上使用 git。唯一的问题,我不确定如何使用 git 连接到我当前的站点。我知道它与 ftps 兼容,因为它在手册中,但我收到错误:

“无法连接到 [我的站点]”“无法解析主机”“致命:HTTP 请求失败”“访问 [我的站点]/info/refs 时出错”

我试过了:

git clone [username]:[pass]@[site] [local repository]

git clone [用户名]@[站点] [本地存储库]

git clone [用户名]@[站点]:[来自 cpanel 的端口] [本地存储库]

git clone [用户名]%40[站点]@[站点] [本地仓库]

没有任何效果。有什么我想念的吗?我需要在服务器上安装一些东西吗?任何帮助表示赞赏。谢谢!

4

2 回答 2

5

> man git-clone

结果是:

GIT URLS
       In general, URLs contain information about the transport protocol, the address of the remote server, and the path to the repository.
       Depending on the transport protocol, some of this information may be absent.

       Git natively supports ssh, git, http, https, ftp, ftps, and rsync protocols. The following syntaxes may be used with them:

       ·   ssh://[user@]host.xz[:port]/path/to/repo.git/

       ·   git://host.xz[:port]/path/to/repo.git/

       ·   http[s]://host.xz[:port]/path/to/repo.git/

       ·   ftp[s]://host.xz[:port]/path/to/repo.git/

FTPS 似乎是允许的协议之一。

尝试git clone ftps://host.xz[:port]/path/to/repo.git/

于 2011-04-18T21:40:02.457 回答
2

我认为你错过了一步。在您可以“克隆”存储库之前,存储库本身必须存在(被初始化)。尝试在您的服务器上克隆一个不是 git 存储库的目录将失败。

于 2011-04-18T21:43:08.770 回答