HOWTO: Installing “git” on bluehost domain hosted websites
Purpose: My website www.koolwal.net which in turns has this blog site that you are reading is being hosted by Bluehost web hosting company. Last week I decided to install the popular source code revision control program called Git on my Bluehost account i.e. on www.koolwal.net. In this blog post we will see how can we install git on Bluehost web hosting accounts and may in general these steps might be true for other web hosting accounts also.
Background
It seems that Bluehost by default does not supports or tells you how to install Git. I also tried posting a query on Bluehost’s forums to see if anybody has done it before but with no luck. So I decided to just go ahead and try this out myself. Also note that you will need to enable the SSH access on your Bluehost account to do this. You can easily enable SSH on your account by sending a request to Bluehost Tech support.
Here are my specs from the Bluehost account:
myuser@koolwal.net [~]# cat /proc/version
Output:
Linux version 2.6.28-9.16.intel.BHsmp (kernel@bluehost.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Sat Apr 18 11:41:59 MDT 2009
myuser@koolwal.net [~]#
Basically it is a Red Hat Linux system with 2.6.28 Linux kernel running. So now we have all the information that we need let’s get started…
Step 1: Download git tarball
Log into your Bluehost account and give the following command:
# wget http://kernel.org/pub/software/scm/git/git-1.6.3.3.tar.bz2
Note: The latest stable release version might have changed since this posting, so you need to substitute in the above command the latest git version that you would like to install or else you can continue with the git version that I ended up installing. You can checkout the latest stable release version of git here.
Step 2: Extract the tarball
Now just extract the tarball installation file in your home directory
# tar -xjvf git-1.6.3.3.tar.bz2
Step 3: Compile the git program
# cd git-1.6.3.3
# make
Now mostly after a while you will get the following error message and your make command will fail:
make[2]: true: Command not found
make[2]: *** [blibdirs] Error 127
make[1]: *** [all] Error 2
make: *** [all] Error 2
It seems that the true command is not installed on the bluehost servers but you type in the command true it seems that it exits:
myuser@koolwal.net [~]# true
myuser@koolwal.net [~]#
This probably means that the git make command is not able to locate the directory in which the true command sits.
Step 4: Fix “true”: Command not found error
The simplest way to fix this error is to create an empty script file called true with just the following line:
#!/bin/sh
Save and exit the file and copy it in your local bin directory after making it executable:
# cd;
# chmod 755 true
# mkdir bin (if the directory does not exits)
# cp true bin/true
and now you can re-issue the make command:
# cd git-1.6.3.3
# make clean
# make
and now after a while you should see the the “make” command finishes without any error.
Step 5: Install the git program
Finally you can install the git software by issuing the following command:
# make install
and you should be able to execute the “git” command on your Bluehost account.
Step 6: Test git
Now it is time to test if the “git” program installed successfully or not.
# mkdir test_project
# cd test_project
# git
# git init
Output:
Initialized empty Git repository in /home1/myuser/test_project/.git/
Congratulations the above output means that your “git” is working just fine and now you can use it for your project that you have been planning.
Happy Giting!

Free Email Subscription









August 5th, 2009 at 6:09 pm
Hi
Thx for this. Very clear to follow. NB Bluehost seem to have fixed the issue with ‘true’ as the ‘make’ worked straight off for me.
In step 6
You either need to change your output to the manual output or make the command ‘git init’ to get the indicated output
Reply to this comment
August 30th, 2009 at 10:30 am
[...] http://blogs.koolwal.net/2009/07/20/howto-installing-git-on-bluehost-domain-hosted-websites/ [...]
September 8th, 2009 at 7:39 pm
When I type git in step six I get the help for git. I only get “Initialized empty Git repository in /home1/myuser/test_project/.git/” when I type git init.
Reply to this comment
Admin Reply:
September 23rd, 2009 at 10:47 pm
Hi Scott,
You are right. That’s a typo. It should have been “git init” in step six. Corrected. Thanks again!
Reply to this comment
September 25th, 2009 at 8:59 am
Hi,
Thanks for the tutorial!
After I enter the make command, I receive the following errors where I reach CC transport.o:
In file included from transport.c:5:
http.h:6:23: error: curl/curl.h: No such file or directory
http.h:7:23: error: curl/easy.h: No such file or directory
In file included from transport.c:5:
http.h:46: error: expected specifier-qualifier-list before ‘CURLcode’
http.h:52: error: expected specifier-qualifier-list before ‘CURL’
http.h:97: error: ‘CURL_ERROR_SIZE’ undeclared here (not in a function)
http.h: In function ‘missing__target’:
http.h:102: error: ‘CURLE_FILE_COULDNT_READ_FILE’ undeclared (first use in this function)
http.h:102: error: (Each undeclared identifier is reported only once
http.h:102: error: for each function it appears in.)
http.h:104: error: ‘CURLE_HTTP_NOT_FOUND’ undeclared (first use in this function)
http.h:106: error: ‘CURLE_FTP_COULDNT_RETR_FILE’ undeclared (first use in this function)
transport.c: In function ‘get_refs_via_curl’:
transport.c:465: error: ’struct active_request_slot’ has no member named ‘results’
transport.c:466: warning: implicit declaration of function ‘curl_easy_setopt’
transport.c:466: error: ’struct active_request_slot’ has no member named ‘curl’
transport.c:466: error: ‘CURLOPT_FILE’ undeclared (first use in this function)
transport.c:467: error: ’struct active_request_slot’ has no member named ‘curl’
transport.c:467: error: ‘CURLOPT_WRITEFUNCTION’ undeclared (first use in this function)
transport.c:468: error: ’struct active_request_slot’ has no member named ‘curl’
transport.c:468: error: ‘CURLOPT_URL’ undeclared (first use in this function)
transport.c:469: error: ’struct active_request_slot’ has no member named ‘curl’
transport.c:469: error: ‘CURLOPT_HTTPHEADER’ undeclared (first use in this function)
transport.c:473: error: ’struct slot_results’ has no member named ‘curl_result’
transport.c:473: error: ‘CURLE_OK’ undeclared (first use in this function)
transport.c:475: error: ’struct slot_results’ has no member named ‘http_code’
transport.c:475: error: ’struct slot_results’ has no member named ‘curl_result’
Would you have any insight on how to correct this?
Sorry for the long post.
Thanks!
Reply to this comment
johnboiles Reply:
September 28th, 2009 at 9:19 pm
I’m also getting all these curl errors. I tried both with the latest git (1.6.4.4) and the one in this tutorial (1.6.3.3)
Reply to this comment
johnboiles Reply:
September 28th, 2009 at 9:33 pm
update: i used ./configure before I did make. It compiled fine, but I couldn’t do make install. So i copied git to ~/bin with ‘cp git ~/bin’
Reply to this comment
October 1st, 2009 at 9:22 am
[...] via http://blogs.koolwal.net/2009/07/20/howto-installing-git-on-bluehost-domain-hosted-websites/ [...]