1. bluehost knowledge base

VPS & Dedicated Hosting: Installing Git

Overview

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 log in.
  2. Then type:
    sudo yum install git

    Note: If you are logging in as root, you do not need to type sudo.
    This will install the Git functions for you.

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

    Note: The use of .git is for conformity with the other .git folders that are created in the repository. You can name the folder whatever you would like.

  2. Change to the new directory: cd example.git
  3. Then type: git --bare init

    Note: The reason for using the --bare is to mark it as the primary repository for this git project. init stands for initializing.

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.

For further assistance, you may contact our Chat Support or Phone Support via 888-401-4678. You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.