To use the 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 below steps to create the Git Repository.
- Login to the server using SSH.
# ssh [email protected] - Once you log into the server, you will have to create a new directory to store the Repository. Run the below command to create the new directory.
# mkdir -p ~/accu/example - 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
- Once you have navigated to the directory(example), you will have to initialize the directory(example) as a Git Directory using the below command.
# git init - Once you fire the above command, the directory will be initialized as Git Repository, as shown below.
Now, you will have to add the above directory in 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.
- Login to the cPanel.
- Click on Git Version Control under the file section.
- Once you click Click on the "Git Version Control," you will see the below page, then click on the "Create button."
- Once the below page opens, click on the toggle button beside "Clone a Repository," as shown in the below screen capture. Once you click on the toggle button, you will see the page as 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.
- Login to the cPanel.
- Click on Git Version Control under the file section.
- Click on the "Create" button as shown in the below screen capture.
- Once you click on the "Create" button, you will see the below screen
. - 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.