32

So I started using Git together with this workflow to make a personal website (mostly for testing and to learn Git) and I am developing it locally on my laptop using Xampp.

But now I would like to make this website public and upload it to my webserver. Problem is, I use a shared hosting plan which means I only have FTP access to my website directory. Can't use SSH or install Git or anything..

I would like to deploy the website and any updates to that webserver, but I was wondering if that was possible with Git with only FTP access? And if not, what would be an advisable way to update my website? Manually drag an dropping files through Filezilla can get a bit tedious.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Gladen
  • 792
  • 2
  • 8
  • 17
  • 2
    http://stackoverflow.com/questions/2950107/git-push-into-production-ftp – Kevin Apr 26 '12 at 12:36
  • 1
    If your host doesn't allow SSH or SFTP, find a different host. (Non-anonymous) FTP is insecure and basically obsolete. – Wyzard Apr 26 '12 at 12:36
  • Not sure about SFTP, will see if they support that. At least SSH is not supported. The host isn't that special, Cheap too. only €35,- per year but it's enough for what I do with it. – Gladen Apr 26 '12 at 13:22

5 Answers5

36

If you have no SSH access to the remote server and the hosting provider doesn't offer a git deploy feature, you won't be able to deploy directly using git.

However, it's always a good idea to track your source code regardless the remote options.

In your case, a good alternative to automate the release process would be to create a simple deploy script in your favorite programming language (Ruby, Python, Bash...) that loads the list of changed files from your git repository and performs an upload via FTP of these files.

A simple search for git-ftp reveals that there are already two projects that seems to do what I suggested:

Nadav S.
  • 2,429
  • 2
  • 24
  • 38
Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
  • Thanks for the quick answer! Too bad I can't use Git directly..I will take a loot at those scripts you mentioned, that seems to be exactly what I was looking for. – Gladen Apr 26 '12 at 12:48
  • "If you have no SSH access to the remote server and the hosting provider doesn't offer a git deploy feature, you won't be able to deploy directly using git." So long for my magic thinking... – Félix Adriyel Gagnon-Grenier Nov 26 '15 at 18:10
1

If you are in a shared hosting plan, its not a good idea to host your own git server as you'll have both space and bandwidth limitations. You can look out for other options such as github or if you want to have a private hosting, there is bitbucket

positron
  • 1,652
  • 1
  • 11
  • 14
1

Maybe think about a different hosting set up?

  1. On a VPS you have more freedom but you need to set up everything yourself.
  2. On a cloud PaaS you will get great technology but pay a little more.
  3. As mentioned above: A private repo hoster with ftp deployment option might also work.

For me, best productivity is most important. Compare costs of web hosting with costs for web development.

Frank Lämmer
  • 2,165
  • 19
  • 26
0

If git is installed on the server (e.g <?php $last_line = system('git --version', $retval); ?>), but you don't have SSH access, perhaps try php-git-bundle.

Joachim Werner
  • 166
  • 1
  • 6
-1

This question may be old but there is a shared web hosting which offers git deployment option and SSH access to git pull/push etc: githoster.com

Or there are some scripts you can search in google which will link your github account to your host with git hooks.

TooCooL
  • 20,356
  • 6
  • 30
  • 49