Installing GIT on Bluehost Shared Hosting

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.

Installing GIT with a Shared Bluehost Account

  1. Enable SSH for your bluehost account. Refer to Bluehost Documentation.

  2. SSH into your bluehost account, and change to your home directory by entering the following command:

    $ cd
  3. 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
  4. Add the following line to .bashrc:

    export PATH=$HOME/.local/bin:$HOME/.local/usr/bin:$PATH

    *Note: This line will specify the installation directory for Git.*
  5. 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
  6. 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”.

  7. 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.

  8. Extract the source into the src directory using the unzip command and remove the zip file.

    $ unzip master
    $ rm master
  9. Navigate into the git-master directory and install using the following commands.

    $ cd git-master
    $ make
    $ make install
  10. Once the source has compiled and installed, you can test the installation by entering the following command:

    $ git

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>]

About the author

Will works as a technical lead for Kanopi Studios and provides Drupal support for a wide range of amazing projects. He current resides in South Carolina along with his wife, son and two dogs. When not working on tech projects, Will enjoys spending time with family and photographing the stars.