How to Clone a Git Repository in cPanel?

Posted on July 2nd, 2019

The Git Version Control is a new feature introduced by cPanel in its latest update in version 72. The new feature allows you to easily host a private or public Git repository on your cPanel account. You can use Git to maintain any set of files (for example, a web site’s files and assets, a software development project, or simple text files).

Git was designed for the Linux kernel, and it is very popular with the development community. By using the Git Version Control feature, you can also clone a repository that already exists on the Web directly into your cPanel account.

Git records all changes we have made on the Git-managed content such as code, text files, etc. And it also stores the history of every line you have changed. In other words, Git stores the data as a series of snapshots. In this documentation, we have discussed how to clone a Git repository on cPanel.

Clone Git Repository on cPanel

There is no command-line work required to deploy your project from Git Repository if you are using cPanel. Just follow the steps given below, and you are good to go.

1) Log into cPanel.

2) Go to Files Section.

3) Choose the option “Git Version Control”.

clone git repository

 

4) If you want to clone a repository that already exists on the Web, toggle on the “Clone a Repository” button.

clone git repository

 

5) Copy the clone URL of the git repository into the “Clone URL” section on the page.

clone git repository

 

6) On the next section, you need to specify the file path for the repository. Please keep in mind that the cloned repository provides its own directory.

clone git repository

 

7) Next, enter a name for the repository in the “Repository Name” section.

clone git repository

 

8) Click on the “Create” button at the bottom of the form.

Now, The cPanel will clone the specified git repository from the git server directly into your cPanel account. If you want to do it from the command line, you can easily enable SSH access in your cPanel.

If you need any further help, please do reach our support department.

5 Responses to “How to Clone a Git Repository in cPanel?”

  1. Shamim Hasan says:

    i’m trying to deploy local->github repo->then cpanel but not working properly. first need to click cpanel github deploay button then deploying but i want to push project to github then its will be automatic deploay to cpanel


    deployment:
    tasks:
    – export DEPLOYPATH=/home/codechcy/public_html/local
    – /bin/cp -r * $DEPLOYPATH

    This is my .cpanel.yml file i don’t know if having error with this code

    please help me how to make github to cpanel autodeploay

    Thanks

  2. Shana Barry says:

    If you need any further help, please do reach our support department.

    ONE RESPONSE TO “HOW TO CLONE A GIT REPOSITORY IN CPANEL?”
    Shamim Hasan says:
    December 4, 2019 at 5:26 pm
    i’m trying to deploy local->github repo->then cpanel but not working properly. first need to click cpanel github deploay button then deploying but i want to push project to github then its will be automatic deploay to cpanel


    deployment:
    tasks:
    – export DEPLOYPATH=/home/codechcy/public_html/local
    – /bin/cp -r * $DEPLOYPATH

    This is my .cpanel.yml file i don’t know if having error with this code

    please help me how to make github to cpanel autodeploay

    Thanks

    • dw-herrmann says:

      I think you misunderstood Git Version Control the same way I did. There are two options: you mirror a GitHub repo to your cPanel server, but you always have to pull by yourself, or you clone something from GitHub and your cPanel becomes your new Git, you deploy to, which updates a website automatically but doesn’t have anything to do with GitHub any more.

  3. Hrishikesh Shukla says:

    I cloned a repo by this method. Now i see a .git directory in cpanel file manager. Is .git required?

Leave a Reply