Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Git with shared hosting plan

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.

like image 229
Gladen Avatar asked Apr 26 '12 12:04

Gladen


People also ask

Can I use git on shared hosting?

Using git in shared platform, developer can deploy latest update easily to shared hosting. If the repository is private, you need to do some extra work to deploy. Before setting up git repository in server, you need to import passwordless SSH key to your server.

Which git provider can be used for hosting?

The most popular Git hosting sites are GitHub and Bitbucket. Both offer free hosting with certain limitations.

Can you use git with Dropbox?

git-remote-dropbox is a transparent bidirectional bridge between Git and Dropbox. It lets you use a Dropbox folder or a shared folder as a Git remote! This Git remote helper makes Dropbox act like a true Git remote.

What is git access in hosting?

Git is a distributed version control system used by many programmers. The cPanel Git Version Control tool provides a convenient graphical interface that allows access to Git features without using the command line. You can use this tool to install and update a web site stored in a Git repository.


2 Answers

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:

  • ezyang/git-ftp
  • git-ftp/git-ftp
like image 81
Simone Carletti Avatar answered Oct 03 '22 04:10

Simone Carletti


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

like image 35
positron Avatar answered Oct 03 '22 06:10

positron