How to set up a git repository on cPanel

A popular topic these days is how to set up your free github.io site on cPanel and connect cPanel in general with GitHub.

First of all, you need to have the Git option enabled in cPanel.

After that, we assume that you already have a repository created on GitHub that is ready to be set up on cPanel itself.

Go to your GitHub repository and then click on “Clone or download”; a small window will appear with a link that you need to copy, as shown in the image below.

phpmailer How to set up a git repository on cPanel

You need to insert the link you copied (in our case, it is: https://github.com/phpmailer/php…) into cPanel.

Open cPanel, then find the “Git Version control” option and click on “Create” (the blue button), as shown in the image below.

cPanel Tools 8 How to set up a git repository on cPanel

The following window will appear:

cPanel Git™ Version Control How to set up a git repository on cPanel

In the “Clone URL” field, enter the URL you copied from GitHub.

In the “repository path“, it will set an automatic path, and you need to set the path for that repository. You should keep public_html, but you can also add an additional folder (for example: public_html/test). If you created a free site on pages.github.io, like in our example, just enter public_html.

In the “repository name“, you don’t need to enter anything; leave it as is and click the button below, “Create”.

If everything is alright, you will receive a message in the top-right corner:

Information: The system successfully initiated the clone process for the “PHPMailer” repository. The system may require more time to clone large remote repositories.

As it says, everything went fine, and you need to wait for some time (it depends on many factors and has no approximate time; you simply need to be patient and wait), and it will appear on that page.

With that, you have completed everything.

Official SSH cPanel Documentation

Scroll to Top