Git clone over ftps

纵饮孤独 提交于 2019-12-10 14:45:56

问题


Okay. So I have my site hosted on InmotionHosting. It's a shared server, so ssh is out. I've been accessing it via FTPS. I use git at work, so I've been curious to start using git for my personal site. Only issue, I'm unsure of how to connect to my current site using git. I know it's compatible with ftps, since it's in the manual, but I get the error:

"failed to connect to [my site]" "couldn't resolve host" "fatal: HTTP request failed" "error while accessing [my site]/info/refs"

I've tried:

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

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

git clone [username]@[site]:[port from cpanel] [local repository]

git clone [username]%40[site]@[site] [local repository]

Nothing works. Is there something I'm missing? Do I need to install something on the server? Any help is appreciated. Thanks!


回答1:


> man git-clone

results in:

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 seems to be one of the allowed protocols.

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




回答2:


I think you're missing a step. Before you can "clone" a repository, the repository itself must exist (be initialized). Trying to clone a directory on your server that isn't a git repository will fail.



来源:https://stackoverflow.com/questions/5709192/git-clone-over-ftps

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!