To use git version control in the cPanel, you must create the Git Repository first. Please be informed that to create the Git Repository, you will need shell access/root access. Therefore, please follow the steps below to create the Git Repository.

Step 1: Log in to the server using SSH.

# ssh [email protected]

Step 2: Once you log into the server, you will have to create a new directory to store the Repository. Run the command below to create the new directory.

# mkdir -p ~/accu/example

Step 3: Once the directory has been created, you will have to navigate to that directory. Run the following command to navigate to the directory.

# cd accu/example

Step 4: Once you have navigated to the directory(example), you will have to initialize the directory(example) as a Git Directory using the command below.

# git init

Once you fire the above command, the directory will be initialized as a Git Repository, as shown below.

Now, you will have to add the above directory to cPanel. We have provided the steps below.

Note: To add, create the Git Repository in the cPanel. The cPanel user should have access to the home directory.

Step 1: Log in to the cPanel.

Step 2: Click on Git Version Control under the file section.

Step 3: Once you click on the "Git Version Control," you will see the page, then click on the "Create button."

Step 4: Once the page below opens, click on the toggle button beside "Clone a Repository," as shown in the screen capture below. Once you click on the toggle button, you will see the page as shown below. First, you will have to add the path to create the Git Repository and name, then click on the "create" button.

You can clone the existing directory as well. We have provided the steps below to clone the GIt Repository.

Step 1: Log in to the cPanel.

Step 2: Click on Git Version Control under the file section.

Step 3: Click on the "Create" button as shown in the screen capture below.

Step 4: Once you click on the "Create" button, you will see the screen below

  • Here, you will have to paste the path of the existing Git Repository.
    (Note: Please be informed that the cloned Repository has its path.)
  • Enter the name of the Repository.
  • Click on the "Create" button shown in the screen capture.

Now, the cloned Repository for your cPanel account has been created.

Was this answer helpful? 0 Users Found This Useful (0 Votes)