5

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!

Joseph
  • 51
  • 1
  • 2
  • As you can see from ninjagecko's answer, you have to specify a protocol to use. (If you leave it off and specify `user@host`, it defaults to ssh.) – Cascabel Apr 19 '11 at 02:26
  • I am having the same issue and nothing on this page has helped – donatJ Aug 18 '11 at 13:29

2 Answers2

5

> 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/

ninjagecko
  • 88,546
  • 24
  • 137
  • 145
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.

A.J. Brown
  • 913
  • 7
  • 14
  • So how would I do this? I've googled, but haven't found anything on this using only ftps. – Joseph Apr 18 '11 at 23:55
  • Unless your host supports it directly, I don't think you can simply create a repository on the server. You don't *need* to have the repository on the remote host though. Just use "git init" to setup a directory locally, then copy down all of your files, use "git add", then "git commit". When you're ready to deploy your changes, just FTP them to your server. You might be able to FTP the .git repository, then setup your SFTP site as a remote, but I'm not sure. – A.J. Brown Apr 19 '11 at 01:43
  • @Joseph: Since a repository is really just a special directory/file structure, the best way to get a bare repo in your hosted space will be to make a bare clone of your repository locally (`git clone --bare `), then use FTP(S) to directly copy it to the server. At that point you should be able to use `git remote add ` in your original repo so you can use the short name instead of the full url when you push/pull. – Cascabel Apr 19 '11 at 02:29
  • This is starting to drive me batty. I've tried creating it locally and copying over, but it keeps asking to update server info. Which I can't do, because I still can't get mac osx to mount my ftp site and make it writable via finder. First I tried Macfusion (which just crashes), then Interarchy. But still for the love of anything, can't git ;-), this to work properly. @AJ. I can run a git status on the server and it shows it's working, but anything beyond that, I can't do thanks to the two not being connected. Any further ideas would help. – Joseph Apr 19 '11 at 07:23
  • @Joseph when you say "on the server", what do you mean? You mentioned not having SSH access. – A.J. Brown Apr 19 '11 at 14:01
  • @A.J. I copied the files from my local git init via Cyberduck. Then did the git status by mounting my site via ftp in finder on mac. But I can't get further than that since finder doesn't give r/w permissions for ftp. – Joseph Apr 19 '11 at 17:24
  • Yes. Upon clicking mount, it just freezes my computer. If I wait till it unfreezes, it unmounts. 10.6.7. I tried the fix I found on google from Racker Hacker, but it didn't work, since the file it says to remove doesn't exist. – Joseph Apr 19 '11 at 17:46