Skip to main content
Git Version Control on cPanel lets you do two things:
  1. Host bare Git repositories on your server. Useful as a private origin you can push to from anywhere.
  2. Clone existing repositories from GitHub, GitLab, Bitbucket, or self-hosted Git into your account, with optional auto-pull deployment to a public folder.
Open it from cPanel home → FilesGit™ Version Control. A fresh account starts empty with a Create button.
Empty Git Version Control page with Create button

Create a repository

1

Click Create

From the Git landing page, click Create. You’ll be asked whether to clone an existing remote or start fresh.
2

Pick the source

  • Clone a Repository. Paste an HTTPS or SSH URL like git@github.com:you/your-repo.git. For private SSH repos, you’ll need an SSH key set up first (see below).
  • New Repository. No remote, just an empty repo on the server you can push to from your laptop.
Git create dialog with Clone or New repository options
3

Set the path

The Repository Path is where the repo lives on disk. A sensible default is repositories/<repo-name>. For an auto-deploy setup, point it at the public folder (public_html/<repo-name>).
4

Name it and create

Give the repo a display name and click Create. cPanel runs git clone (or git init) and shows you the result.

SSH keys for private repos

If you’re cloning a private GitHub or GitLab repo over SSH, the server needs an SSH key the remote provider trusts. SSH keys are managed from a separate cPanel page: SecuritySSH AccessManage SSH Keys.

Generate a new key

1

Open SSH Access

cPanel home → SecuritySSH AccessManage SSH Keys.
2

Click Generate a New Key

Pick a key name. Leave the password empty for unattended deploys, or set one if you want extra protection. Pick ed25519 for the type. Click Generate Key.
3

Authorize the key on your account

Back at Manage SSH Keys, find your new key under Public Keys and click ManageAuthorize. This adds the key to ~/.ssh/authorized_keys so the server itself can use it.
4

Copy the public key to your Git provider

Click View next to the public key, copy the full text, and paste it into GitHub → Settings → SSH Keys (or your provider’s equivalent).
You can now clone private repos from that provider via SSH URL. cPanel uses the authorized key automatically.

Use an existing key

If you already have an SSH key pair on your local machine, paste the public key into Import Key instead of generating a new one. The private key never leaves your machine.

Pull updates and deploy

Once a clone is set up, the repo’s Manage page has a Pull or Deploy tab.
  • Pull from Remote. Runs git pull with the configured remote and branch. Use this for manual deploys.
  • .cpanel.yml deployment. If your repo contains a .cpanel.yml file at the root, cPanel runs the tasks defined inside on every pull. Common pattern: copy files from the cloned repo into public_html/ so the live site updates without serving the .git/ directory directly.
A minimal .cpanel.yml:
---
deployment:
  tasks:
    - export DEPLOYPATH=/home/username/public_html/
    - /bin/cp -R src/* $DEPLOYPATH

Things to know

  • Cloned repos via the New Repository flow are bare. Clones from a remote are working trees.
  • Cloning a repo with submodules works via HTTPS or SSH if the right keys are in place.
  • Repos placed under public_html/ will have their .git/ folder served unless blocked by .htaccess. Either deploy to a separate folder, or block .git/ requests in your web server config.
  • Private repos cloned over HTTPS need credentials cached or a personal access token in the URL. SSH is simpler for unattended deploys.

Need a hand?