Git Publish to shared server (eg: GoDaddy ssh) 

As a web developer, there’s nothing more I hate than not having the right tools to get the job done quickly or at an optimal speed. Aside from that, many hosting servers, for example GoDaddy, makes it even frustrating to work without access to version control and sometimes without SSH access when your clients hosting plans is on a shared plan. Not able to use Git (or SVN which ever you prefer) makes it a pain in the ass to commit changes, update the site quickly and show your talents.

So you know what I did of course, yes you do. I created an alternative tool that would alleviate the suffering of having to use FTP each time to update the website. I present to you my version of Git Publish to GoDaddy shared servers and the likes:

The script is very simple to use, just edit your SSH settings within the file then open up that trusty terminal window and run as such:

sh Git_Publish_To_Shared_Server.sh

The script will archive in a file the latest git commits since you last did your Git Push. It will secure copy the archived (tar.gz) file to your SSH server, then extract the archived file and update your remote files instantly.

The script checks if the current repository is clean or dirty, which will warn you in case its not clean. After you’ve commited your changes locally, its time to upload the most latest changed/added files to the website hosting via SSH. But don’t worry too much, the only thing the script asks you each time is your ssh password. (No, it does not store the password nor send it over to me) … just take a look and see how tiny yet useful it will be to you.

Happy Hacking.