Home PageArchiveContact UsAbout Us
If you are hopelessly addicted to drupal;
if bringing yourself to bed is allways a strugle;
if your main source of entertainement
is watching lullabot videos; then you belog

Set Up GIT in a Godaddy Shared Hosting Account

See video

What Operating System is used to host your website?

The first thing you will need to do is to login to your Godaddy account via SSH. If you don't have SSH access to your Godaddy Account yet, just call them and ask for it. They have an excellent technical support service over the phone. Now, you need to get the version of the server that is hosting your website. It will be most likely a CentOS Linux server. To check this out you will need to do the following in your SSH terminal window:
[drupalfever@drupalfever.com ~]$ cat /etc/*-release CentOS release 5.5 (Final)
To find out if this version of CentOS is a 64bit or a 32bit operating system, you do the following:
[drupalfever@drupalfever.com ~]$ uname -m i686
The i686 means that this is a 32bit operating system.

Getting the Rigth Version of CentOS

Now you need to create a CentOS virtual machine. The virtual machine has to be of the same version as the one in your Share Hosting account. CentOS 5.5 is an older version. To get an older version of CentOS you can go to the following URL: http://vault.centos.org/ I saw all over the Internet that you only needed to run a Live CD to be able to generate the files that you needed. I tried several times to do this just with the Live CD but I would always get into an error message that I could never get around of. Following is the error message that I was getting:
IOError: [Errno 30] Read-only file system
I finally decided to get the full Binaries and do a full installation. The full ISO DVD can only be downloaded via Torrent. I have Bitcomet but you can use any Torrent client to download this CD image.

Creating a Virtual Machine

You will ned to have VirtualBox installed in your computer to create a Virtual Machine. Luckily, VirtualBox is free so, once you have it up and running in your computer, you will be able to continue. You will need to do the following to create your CentOS 5.5 Virtual Machine:
  1. More memory than the minimum which is 512MB. At list 2GB.
  2. Storage: A dynamically Allocated Storage device with 8GB should be more than enough.
  3. After creation change the following settings:
    1. Network: Attached to = "Bridged Adapter".
    2. Storage:
      1. Choose a virtual CD/DVD disk file... = Mount CentOS DVD ISO Image.
      2. CD/DVD Drive = From "IDE Secondary Master" to "IDE Primary Master".
Now you boot into your new Virtual Machine and do a normal installation.

Installing GIT in your Virtual Machine

When you are done with the installation of CentOS, log into it, open a terminal window, and type the following:
[root@localhost ~]# yum -y install gcc gcc-c++ make expat-devel gettext-devel curl-devel openssl-devel zlib-devel bzip2
Now, you can Google for the latest version of GIT Source Code. The latest version of GIT as of this writing is GIT Execute the following on your terminal to download this version of GIT:
[root@localhost ~]# wget http://git-core.googlecode.com/files/git-
Now, to decompress the file that has just been downloaded you do the following:
[root@localhost ~]# tar -xzf git-
Now, you need to enter into the new folder and execute the following two commands
[root@localhost ~]# cd git- [root@localhost git-]# make [root@localhost git-]# make install
Now that the folders have been created, we need to compress them before we can upload them to the Godaddy server.
[root@localhost git-]# cd .. [root@localhost ~]# tar cvfj bin.tar.bz2 bin [root@localhost ~]# tar cvfj lib.tar.bz2 lib [root@localhost ~]# tar cvfj libexec.tar.bz2 libexec [root@localhost ~]# tar cvfj share.tar.bz2 share
To upload thes files to your Shared Hosting Account, you need to do the following:
[root@localhost ~]# scp bin.tar.bz2 drupalfever@drupalfever.com: [root@localhost ~]# scp lib.tar.bz2 drupalfever@drupalfever.com: [root@localhost ~]# scp libexec.tar.bz2 drupalfever@drupalfever.com: [root@localhost ~]# scp share.tar.bz2 drupalfever@drupalfever.com:
If you are creating these files for a 64bit Server, you also need to do the following:
[root@localhost ~]# tar cvfj lib64.tar.bz2 lib64 [root@localhost ~]# scp lib64.tar.bz2 drupalfever@drupalfever.com:

Installing GIT in your Shared Hosting Account

Now is time to go back to your Godaddy Shared Hosting account via SSH and decompress the files that you just uploaded. To decompress the uploaded files you need to do the following:
[drupalfever@drupalfever.com ~]$ tar -xvjf lib.tar.bz2 [drupalfever@drupalfever.com ~]$ tar -xvjf libexec.tar.bz2 [drupalfever@drupalfever.com ~]$ tar -xvjf bin.tar.bz2 [drupalfever@drupalfever.com ~]$ tar -xvjf share.tar.bz2
Again, if you are trying to do this on a 64bit server, you will also need to do the following:
[drupalfever@drupalfever.com ~]$ tar -xvjf lib64.tar.bz2
Finally, on your GoDaddy account's root folder, create a ".profile" file with "VI":
[drupalfever@drupalfever.com ~]$ vi .profile
To start entering content into the ".profile" file in "VI", you will first need to enter into "Insert" mode by pressing the i key. If you already have some content in your ".profile" file, add the following to the end of the file:
export PATH="$PATH:~/bin" export LD_LIBRARY_PATH=~/lib export GIT_EXEC_PATH=~/libexec/git-core export GIT_TEMPLATE_DIR=~/share/git-core/templates
If you are working on a 64bit machine, you will have to type the following instead:
export PATH="$PATH:~/bin" export LD_LIBRARY_PATH="~/lib:~/lib64" export GIT_EXEC_PATH=~/libexec/git-core export GIT_TEMPLATE_DIR=~/share/git-core/templates
To save and close the VI editor you will need to press the Esc key and type the following:
Now you need to press the Enter key to save and exit. Now, before testing your GIT installation, you will need to log out and log back into your Godaddy Account via SSH.
Average: 5 (1 vote)

vi .profile

Hi All the step I can do but at the end.  creating .profile file there is notting do when I pressed esc. What can I do?

A few issues

I also had to add to my .profileexport GIT_CONFIG_NOSYSTEM=1otherwise I would get errors trying to do any git command saying that /root/etc/gitconfig permission deniedI'm still having problems running git clone.  I'm getting the following error:fatal: cannot exec 'ssh': Permission deniedLooks like I'll have to repeat the process for ssh, hopefully that's the last one

Alternative to GIT_CONFIG_NOSYSTEM=1

As an alternative to GIT_CONFIG_NOSYSTEM=1 When building (the "make" command) instead of just "make" use "make sysconfdir=/etc" (That or set ETC_GITCONFIG)

GoDaddy blocks outbound SSH access!

Because GoDaddy blocks outbound SSH access, You cannot "git clone" via SSH. All "git clone" commands have to be done through HTTPS.

SSH works for push and pull for me

First, thanks for the great instructions. However, I don't find SSH blocked for my shared Linux account. I am able to clone, push to and pull from Git using SSH.In case it helps anyone, this is what I found in December, 2013 for GoDaddy Linux Delux shared hosting:The host is 64-bit linux kernel 6.2.32 determined from: 'cat /proc/version'. To build Git I downloaded 64-bit CentOS 6.5 DVD isos and created the VBox VM per this tutorial. The 64-bit Git binaries built on the VM appear to be compatible with the shared hosting server.

almost perfect

I followed this tutorial and the video to the letter and I'm amazed that so much of it worked as described.To show my appreciation, I'll list what didn't work so others may not have to spend the time I did researching.Everything worked up to the point where I was to use yum to install the packages needed to run a compiler.Basically the error message:<code>"Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons error was ..."</code>some error codeNothing I tried with proxy manipulation worked.Here is what did the trick:So please check your /etc/resolv.conf is right or not. I can simply add search local nameserver : <a href="http://linuxtours.blogspot.com/2011/04/how-to-fix-error-cannot-find-valid.html">http://linuxtours.blogspot.com/2011/04/how-to-fix-error-cannot-find-valid.html</a> I don't know yet "why" it worked, but obviously there is a DNS issue wit centos, virtual box and my laptop. This fixed it and I was able to finish this procedure in its entirity. Now my question is... how can I use git on the hosting server? In this case godaddy. The promise is to be able to make a master git repository exist on the project files in godaddy, and allow clones to be pulled onto my laptop for development and then pushed back to the master on godaddy when they have been tested. This actcle has been so complete and helpful, I wonder if the author might expand this last part and provide such an example? 

I'm also trying to push/pull

I'm also trying to push/pull under a GoDaddy Shared hosting. +1 please!