GIT is a valuable tool for maintaining version control for project files. Unfortunately Bluehost does not provide “out of the box” support for installing or configuring git, so in order to get it installed on a shared Bluehost account the installation must be performed manually. The following is a guide for installing the GIT version control package on a shared Bluehost environment.
Enable SSH for your bluehost account. Refer to Bluehost Documentation.
SSH into your bluehost account, and change to your home directory by entering the following command:
We will need to edit the .bashrc file that resides in the home directory. If this file does not exist, you can create it now. Use nano to edit the file, or create the file if it does not already exist:
$ nano .bashrc
Add the following line to .bashrc:
*Note: This line will specify the installation directory for Git.*
If you do not already have a folder called “.local” then create one by using the mkdir command; you should still be in the home directory. Once you have created the .local directory, you will then move into that directory.
$ mkdir .local $ cd .local
Create a new directory called src and change to that directory:
$ mkdir src $ cd src
Note: The source directory should path should look like “/home#/username/.local/src”.
Download the Git source code into the src directory using the wget command:
$ wget --no-check-certificate https://github.com/git/git/archive/master.zip
Note: The file downloaded will sometimes not have the .zip extension, however you can still extract the source using the unzip command.
Extract the source into the src directory using the unzip command and remove the zip file.
$ unzip master $ rm master
Navigate into the git-master directory and install using the following commands.
$ cd git-master $ make $ make install
Once the source has compiled and installed, you can test the installation by entering the following command:
If GIT was installed successfully, then the GIT help menu should be returned:
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] [-c name=value] [--help] <command> [<args>]