Skip to main content
cPanel includes Git Version Control, which lets you host Git repositories directly on your hosting account — useful for deploying sites with git push and for keeping private repositories.

Creating a repository

  1. Log in to cPanel.
  2. In the Files section, click Git Version Control.
image
  1. Click Create.
  2. Either:
    • Clone an existing repository: enable Clone, paste the clone URL (e.g. from GitHub), and set the repository path, or
    • Create a new empty repository: disable Clone and set the path and name.
  3. Click Create.

Pushing to your cPanel repository

Your repository’s clone URL uses SSH:
(The exact URL is shown in the repository’s details in cPanel.) On your local machine:
SSH access must be enabled on your account for git-over-SSH to work. Your SSH port and credentials are the same as for shell access — see SSH overview.

Deploying on push

cPanel supports push-to-deploy with a .cpanel.yml file in the repository root:
When you push to the repository (and the working tree is clean), cPanel runs the tasks — in this example copying files to public_html. You can also trigger deployment manually with Manage → Pull or Deploy → Deploy HEAD Commit.

Managing repositories

From Git Version Control you can:
  • View the repository’s clone URL and current branch
  • Pull changes from a linked remote
  • Deploy manually
  • Remove repositories (files remain on disk unless you delete them)
Keep your repository outside public_html (e.g. in /home/username/repositories/) and deploy into public_html with .cpanel.yml — this way your .git directory and source files aren’t web-accessible.