How To Use cPanel Git Version Control To Install & Update Site

Git is a distributed version control system used by many programmers. The cPanel tool provides a convenient graphical interface that allows access to Git features without using the command line. It can be used to install and update a web site stored in a Git repository This article shows how to perform an installation with a simple ‘Hello World!’ example. The same steps can be used to install an application of any size. In this example, a developer has created a web page and placed it in a repository on Github. 


To install a site from a Git repository, follow these steps:

  1. Log in to cPanel.
  2. In the FILES section of cPanel, click the Git Version Control icon.

  3. On the Git Version Control page, click the Create button.

  4. On the Create Repository form, the Clone Repository switch is on by default. Since the site will be installed by cloning a repository, no change is required. In the Clone URL textbox, enter the URL of the repository to clone. In the example, the site is being cloned from Github.

  5. In the Repository Path textbox, enter the path to the document root of the site.

  6. In the Repository Name textbox, enter a descriptive name for your repository.

  7. Click the Create button.

In the document root directory there is now the index file containing the ‘Hello World!’ message and a .git directory that contains files used by Git. 


The site developer has created an ‘About’ page to supplement the ‘Hello World’ message and has added it to Github. Follow these steps to update the site:

  1. In the FILES section of cPanel, click the Git Version Control icon.

  2. Locate the ‘hello_world’ repository and click the Manage button.

  3. Click the Pull or Deploy tab.

  4. Click the Update from Remote button.

The new ‘About’ page is copied into the document root directory.