Guide to Git — Set Up Deployment

This article explains how to configure deployment for Git repositories managed through cPanel’s Git Version Control interface. It covers both push and pull deployment methods, how to prepare repositories, how to use the .cpanel.yml deployment file, and how to push or pull changes for automated or manual deployment.

Git DeploymentcPanel Git,cpanel.yml

~3 min read • Updated Feb 21, 2026

1. Overview


cPanel’s Git Version Control interface (cPanel » Home » Files » Git Version Control) allows you to configure deployment for repositories hosted on your cPanel account. While many deployment configurations are possible, this guide explains two primary deployment types:


  • Push Deployment — Automatically deploys changes when you push updates to the cPanel-managed repository.
  • Pull Deployment — Allows you to manually pull and deploy changes from a remote repository using the cPanel interface.

If you encounter issues, refer to:


  • Set Up Access to Private Repositories
  • Git Version Control Series: Git Problems and How to Fix Them

2. Set Up Push Deployment


Recommended deployment method.


2.1 Create an Empty Repository on Your cPanel Account


If the repository does not already exist, create a new empty repository using the Git Version Control interface.


Important: Do not clone a remote repository during this step. Create an empty repository only.


2.2 Clone the Remote Repository to Your Local Computer


git clone URL

Important: Private repositories require additional SSH setup. See the Set Up Access to Private Repositories documentation.


You can find the clone URL in cPanel:


  • Open Git Version Control
  • Click Manage on the desired repository
  • Copy the URL under Clone URL

2.3 Create the .cpanel.yml Deployment File


To enable deployment, you must commit a .cpanel.yml file to the top-level directory of your repository.


Example:


---
deployment:
 tasks:
 - export DEPLOYPATH=/home/user/public_html/
 - /bin/cp index.html $DEPLOYPATH
 - /bin/cp style.css $DEPLOYPATH

For more details, see the Deployment documentation.


2.4 Add the cPanel-Managed Repository as a Remote


git remote add origin URL

Replace URL with the clone URL of the cPanel-managed repository.


2.5 Push Changes to the cPanel-Managed Repository


git push -u origin HEAD

Once the repository contains the .cpanel.yml file, cPanel will automatically deploy any changes you push.


Important: If push fails, the repository may be private and require SSH access.




3. Set Up Pull Deployment


3.1 Clone the Remote Repository to Your cPanel Account


If the repository does not already exist on your cPanel account, use the Git Version Control interface to clone it.


Note: cPanel enforces restrictions on clone URLs and verifies SSH host keys.


3.2 Clone the Remote Repository to Your Local Computer


git clone URL

3.3 Create the .cpanel.yml File


Commit a .cpanel.yml file to the repository:


---
deployment:
 tasks:
 - export DEPLOYPATH=/home/user/public_html/
 - /bin/cp index.html $DEPLOYPATH
 - /bin/cp style.css $DEPLOYPATH

3.4 Push Changes to the Remote Repository


git push origin HEAD

3.5 Pull and Deploy Changes from the cPanel Interface


  • Open cPanel » Home » Files » Git Version Control
  • Click Manage on the repository
  • Open the Pull or Deploy tab
  • Click Update from Remote to pull changes
  • Click Deploy HEAD Commit to deploy

This deployment type does not deploy automatically. You must repeat these steps each time.


Conclusion


By configuring push or pull deployment, you can automate or manually control how your Git-based projects deploy through cPanel. Push deployment provides full automation, while pull deployment gives you manual control through the cPanel interface.


Written & researched by Dr. Shahin Siami