Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git repository on ftp server

Tags:

git

git-clone

ftp

I have ftp server and I cannot install additional software on it. Is it possible to create on it git repository and clone to local pc? I tried to create local repository and copied it to ftp. Will it work? How can I clone from ftp server?

like image 846
szaman Avatar asked Feb 28 '11 11:02

szaman


People also ask

Can you use GitHub for FTP?

Once you've connected your GitHub repository, you'll be automatically directed to the New Server screen. Here, you'll be able to enter a name for your server, then choose FTP as the protocol. We've created a simple free hosting site so we'll just use the same details here we'd enter when connecting via our FTP client.

What is Git FTP?

Git-ftp is an FTP client using Git (http://git-scm.org) to determine which local files to upload or which files to delete on the remote host. It saves the deployed state by uploading the SHA1 hash in the . git-ftp. log file. There is no need for Git to be installed on the remote host.


2 Answers

There are various other questions on StackOverflow that discuss this subject, e.g.:

  • Git fails to push to ftp-server
  • Does GIT support push to an ftp server?

... which might have a solution that's suitable for your case.

You don't say what operating system you're using, but if it's Linux-based what I would try is to mount the FTP server as part of your local filesystem with FUSE + fuseftp. If you're using Mac OS, you could similarly try MacFuse. (n.b. I've never tried fuseftp, myself, so I'm not in a position to recommend or disrecommend it.) No doubt there are equivalents for Windows as well.

Then you should just be able to run git init --bare in the mounted directory and push and pull from it as it it were a local repository. You should also enable the example post-update hook so that git update-server-info is run after each push - otherwise people will have problems when interacting with the server with an ftp:// repository URL.

like image 65
Mark Longair Avatar answered Oct 17 '22 06:10

Mark Longair


It will work if Git is running on the server.

But from what you are describing, I would guess it isn't.

like image 31
Kristian J. Avatar answered Oct 17 '22 05:10

Kristian J.