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

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue