I recently decided to put some of my old projects into Git repos in order to more easily update changes on the various environments that the projects live on. The most common scenario would be to make changes locally on my MAMP server, push the changes to a private repo hosted by Bitbucket, and pull them down on my web server hosted by Bluehost. Tonight I finally sat down and made it happen.
I have been committing changes to my BitBucket repos for awhile now, and it’s pretty easy to get that set up locally, so I’m going to skip ahead.
Install Git on Bluehost
I found Codepie’s write-up on how to install Git on a Bluehost account to be spot on. Be sure to visit the Git project on Google Code for the version archives.
Configure Git
The next step I followed was to configure Git properly. The First-Time Git Setup documentation does a great job walking you through the steps.
Add SSH key
I wanted to clone a project into a directory on my Bluehost server, but I first needed to allow the server access to the repositories. Fortunately, BitBucket has a step-by-step walkthrough of how to set up SSH for Git. My Bluehost account already had an id_dsa and id_dsa.pub, but I don’t know/remember the passphrases for those, so I just ran through the BitBucket instructions and created id_rsa/id_rsa.pub, which worked fine.
Clone!
Once I finished setting up Git, I was able to start cloning repos onto my Bluehost server. Using these slightly complicated, but easy-to-follow steps, I was able to get Git up and running on my web server hosted by Bluehost. The next step is to introduce Git Flow into my workflow at home.
Did this help? Do you have a better way?
Thanks for this – very helpful!
Very helpful indeed. I’ve got my git setup on bluehost and I’m able to pull files. Thanks!
The link ‘http://codepie.org/install-git-on-bluehost-shared-hosting.html’ is broken.