How to Use Git Version Control in Cpanel to Install a Site

cPanel enables website owners and programmers to utilize the features of Git using its Git Version Control tool. The tool provides an intuitive graphical interface to access Git features without having to use the command line. In this tutorial, you will see how you can install a site using Git version control in cPanel in an easy and quick method. Follow these steps and unlock seamless installation directly from a Github repository.

Step 1:

Log into your cPanel account
by entering the username and password for your account. You will be directed to the cPanel home page.

Step 2:

Go to the Files section of the cPanel homepage.
You will see the Git Version Control icon. Proceed by clicking on it.

screenshot of Files panel in cPanel

Step 3: The Git Version Control page will appear.

Click on the Create option.

screenshot of Git Version Control panel in cPanel

Step 4:

Ensure that the Clone a Repository slider is enabled on the Create Repository page.

Step 5: Now, you’ll have to enter the repository URL that you want to clone which contains the site to be installed.

In the Clone URL box, enter the URL of the repository. We’re taking a repository from GitHub in this example.

Step 6: Enter the path to the document root of the site in the Repository Path text box.

Note: Although the document root directory is generally public_html, you can install the site in a subdirectory beneath public_html. However, if you do this, you need to ensure that you set the correct permissions for the directory. Otherwise, it won’t be visible.

screenshot of Git Version Control in cPanel

Step 7:

Now, enter the name of your repository in the Repository Name text box.

Step 8:

Finally, hit the Create button.

screenshot of Create button

After step 8, you will find that the document root directory contains the index.html file and a .git directory that contains files used by Git.

Note: The .git directory will not be visible to site visitors by default.

And there we go! Following these eight simple steps, you will have installed a site using Git version control in cPanel.

Was this article helpful?