1. bluehost knowledge base

VPS & Dedicated Hosting: Installing Git

Git is a great open-source application to help you track the versions of files and projects that you work on.

You will need to make sure that you have Sudo Access enabled. If you have not enabled Sudo access please see Enabling Sudo Access to learn how to do so.

Here is how you install Git,

  1. Open an SSH client and login.
  2. Then type: sudo yum install git
  3. Note: If you are logging in as root you do not need to type sudo.
    This will install the Git functions for you.

Note: If you encounter an error regarding perl, try using: 
yum install git --disableexcludes=main --skip-broken

To set up a repository on the server you will want to,
  1. Make a directory for the repository. mkdir example.git
  2. Note: The use of .git is for the conformity with the other .git folders that are created in the repository. You can name the folder whatever you would like.
  3. Change to the new directory. cd example.git
  4. Then type: git --bare init
  5. Note: The reason for using the --bare is to mark it as the primary repository for this git project. init stands for initialize.
That will have set up the repository for you to push to.
To learn more on how to use Git, please go to Git - Documentation.