Navigate to cPanelsGit Version Controlinterface (cPanel HomFiles Git Vsi Ctrol).

Guide to Git™ – How to Set Up Deployment

Create an empty repository on your cPanel account.

Clone the remote repository to your local computer.

Add the cPanel-managed repository as a remote.

NavigatetocPanelsGitVersionControlinterface(cPanelHomeFilesGitVersionControl).

Push changes to the cPanel-managed repository.

Clone the remote repository to your cPanel account.

NavigatetocPanelsGitVersionControlinterface(cPanelHomeFilesGitVersionControl).

Clone the remote repository to your local computer.

Push changes to the remote repository.

Pull and deploy changes from the cPanel interface.

Would you like to provide more feedback on this document?

Create an empty repository on your cPanel account.

Clone the remote repository to your local computer.

Add the cPanel-managed repository as a remote.

Push changes to the cPanel-managed repository.

Clone the remote repository to your cPanel account.

Clone the remote repository to your local computer.

Push changes to the remote repository.

Pull and deploy changes from the cPanel interface.

Guide to Git™ – How to Set Up Deployment

cPanelsGit Version Controlinterface (cPanel Home Files Git Version Control) allows you to configure deployment for your cPanel-managed repositories. While many deployment configurations are possible, this document only outlines two types of deployment that you can configure.

Pushdeployment first pulls changes from a remote repository to your local computer. Then, you can push them to your cPanel-managed repository. The system will automatically deploy changes that you push to the cPanel-managed repository.

Pulldeployment pulls changes from a remote repository to your local computer and pushes new changes from your local computer to the remote repository. You can then use theGit Version Controlinterface (cPanel Home Files Git Version Control) to manually deploy changes that you pull from the remote repository.

If you experience issues when you configure Git deployment, read the following documents:

Guide to Git – Set Up Access to Private Repositories

Git Version Control Series: Git Problems and How to Fix Them

We recommend that you use this type of deployment.

If the repository that you wish to deploy does not already exist on your cPanel account, use cPanelsGit Version Controlinterface (cPanel Home Files Git Version Control) to create one.

For this type of deployment, donotclone a remote repository during this step. Instead, create an empty repository.

If you have not already cloned it, clone the remote repository. For example, run the following command to clone a repository, whereURLrepresents the remote repositorys clone URL:

To clone private repositories, you must perform additional steps. If you do not perform these steps, you will experience errors when you attempt to use Git. For more information, read ourGuide to Git – Set Up Access to Private Repositoriesdocumentation.

You can find the repositorys clone URL by performing the following steps:

Navigate to cPanelsGit Version Controlinterface (cPanel Home Files Git Version Control)

Locate the desired repository in the list of repositories and clickManage.

The URL appears under theClone URLheading.

In order to deploy changes from a cPanel-managed repository, youmustcheck a.cpanel.ymlfile in to the top-level directory of your repository. You can create and commit this file to your local computers copy of the repository, or you can create and commit it on the remote repository.

If you use the remote repository, you will require read-write access or can submit a pull request to the remote repository.

This tutorial uses changes from the local computer rather than the remote repository.

For example, a.cpanel.ymlfile may resemble the following example:

For more information about the.cpanel.ymlfile, read ourGuide to Git – Deploymentdocumentation.

From your local computer, run the following command to add the cPanel-managed repository as the local computers remote:

In this command,URLrepresents the cPanel-managed repositorys clone URL.

From your local computer, run the following command to push the changes from your local computer to the cPanel-managed repository:

After the cPanel-managed repository contains the.cpanel.ymlfile, the system will automatically deploy any changes that you push to it.

If you experience errors when you attempt to push your changes, the repository may be private and require SSH access. For more information, read ourGuide to Git – Set Up Access to Private Repositoriesdocumentation.

Clone the remote repository to your cPanel account.

If the repository that you wish to deploy does not already exist on your cPanel account, use cPanelsGit Version Controlinterface (cPanel Home Files Git Version Control) to clone the desired remote repository.

This feature enforces several restrictions on clone URLs, and it verifies the remote hosts public SSH keys forssh://clone URLs.

If you havenotalready cloned the remote repository, use the terminal on your local computer to clone the remote repository.

For example, run the following command to clone a repository, where URL represents the remote repositorys clone URL:

In order to deploy changes from a cPanel-managed repository, youmustcheck a.cpanel.ymlfile in to the top-level directory of your repository. You can create and commit this file to your local computers copy of the repository, or you can create and commit it on the remote repository.

If you use the remote repository, you willrequireread-write access or can submit a pull request to the remote repository. This tutorial uses changes from the local computer rather than the remote repository.

For more information about the.cpanel.ymlfile, read ourGuide to Git – Deploymentdocumentation.

From your local computer, run the following command to push the changes from your local computer to the remote repository:

To pull the changes from the remote repository and then manually deploy them, perform the following steps:

Navigate to cPanelsGit Version Controlinterface (cPanel Home Files Git Version Control).

Locate the desired repository in the list of repositories and clickManage.

ClickUpdate from Remoteto pull changes from the remote repository.

ClickDeploy HEAD Committo deploy your changes.

Repeat these steps each time that you wish to pull and deploy changes. The system willnotdeploy changes for this deployment type automatically.

© 2021 All Rights Reserved /Legal NoticesPrivacy PolicyTransparency Report

cPanel, WebHost Manager and WHM are registered trademarks of cPanel, L.L.C. for providing its computer software that facilitates the management and configuration of internet web servers.

Leave a comment