How to Use Git Version Control in cPanel for Deployment

Overview

The Git™ Version Control feature in cPanel allows you to easily manage and deploy code from Git repositories. This is especially useful for deploying websites or applications by integrating version-controlled code directly from platforms like GitHub, GitLab, or Bitbucket into your cPanel hosting environment.

With Git deployment, you can:

  • Automatically push code changes from your local machine.
  • Manually pull code updates from a remote repository.
  • Maintain code integrity and control in development and production environments.

Note
SSH access must be enabled to use Git with remote repositories. If it's not active by default, please contact technical support to request SSH access.

Methods to Use Git Deployment in cPanel

Method 1: Using Your Local Computer as an Intermediary

In this workflow, your local machine acts as a bridge between a remote repository (e.g., GitHub) and the cPanel repository.

  1. Pull the latest code from your remote repository to your local computer using:git pull origin main
  2. Push the changes from your local machine to the cPanel-hosted repository using:git push cpanel-repo main

Method 2: Connecting cPanel Directly to the Remote Repository

This method allows you to link your remote repository (e.g., GitHub) directly to cPanel, and then:

  • Deploy updates by clicking “Update from Remote” inside the Git Version Control interface.

To set this up:

  1. Log in to cPanel.
  2. Go to Git Version Control under the Files section.
  3. Click Create and enter the remote repository URL.
  4. Once created, click “Manage” and use the “Pull or Deploy” options as needed.
Share this:
FacebookTwitterWhatsAppViberCopy LinkTelegramLinkedIn
Updated on May 5, 2025
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support