We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.
We will continue to maintain our API documentation on this server.
In This Document
The Git™ Version Control feature allows you to deploy your cPanel-managed repositories. Generally, deployment sends finished code into production. You can use different configurations to automatically (push deployment) or manually (pull deployment) deploy changes.
For example, you could use deployment to make changes to your website locally. Then, automatically send them to a directory on your cPanel account.
For more information about how to deploy changes, read our Git Version Control documentation.
For more information about how to troubleshoot problems with this feature, read our Guide to Git - For System Administrators documentation.
Before deployment, repositories must meet the following requirements:
A valid checked-in
.cpanel.yml file in the top-level directory.
One or more local or remote branches.
If a repository does not meet these requirements, the system will not display deployment information. Also, it will disable deployment functionality.
.cpanel.yml file determines how and where the changed files deploy. You must check a
.cpanel.yml file in to the top-level directory for each cPanel-managed repository that you deploy.
.cpanel.yml files must use the format in the examples below.
*), to deploy all files. This could deploy items like the
.gitdirectory and cause serious problems.
.cpanel.yml file deploys the
style.css files to the
.cpanel.yml file deploys all files in the
images directory to that directory in the
To add comments to this file, add a line that begins with the hash character (
cPanel's Git Version Control feature (cPanel >> Home >> Files >> Git Version Control) automatically adds a
post-receive hook to all cPanel-managed repositories.
.cpanel.ymlfile, the hook deploys those changes automatically.
Automatic push deployment of a website.
With push deployment, a single
git push command sends changes from your local computer to your cPanel-managed repository. The system then automatically runs the commands in your
.cpanel.yml file. This configuration will send changes from the cPanel-managed repository to a production directory. (For example, to the directory that contains your website's public files.)
You can use manual deployment to deploy your repository again without new changes.
Manual pull deployment of a website with a remote repository.
With pull deployment, the
git push command sends changes from your local computer to a remote repository. When you click Update from Remote in the Pull or Deploy tab of the Manage section of the Git Version Control interface (cPanel >> Home >> Files >> Git Version Control), the system retrieves changes from the remote repository and applies them to the cPanel-managed repository. When you click Deploy HEAD Commit, the system runs the commands in your
.cpanel.yml file to send changes from the cPanel-managed repository to a production directory. (For example, to the directory that contains your website's public files.)
There is no content with the specified labels