> ## Documentation Index
> Fetch the complete documentation index at: https://kb.stablepoint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to host Git repositories with cPanel

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](https://files.readme.io/76e0f5c-git_version.png)

3. Click **Create**.
4. 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.
5. Click **Create**.

## Pushing to your cPanel repository

Your repository's clone URL uses SSH:

```shell theme={null}
ssh://username@yourdomain.com:PORT/home/username/repositories/myrepo
```

(The exact URL is shown in the repository's details in cPanel.) On your local machine:

```shell theme={null}
git remote add cpanel ssh://username@yourdomain.com:PORT/home/username/repositories/myrepo
git push cpanel main
```

<Note>
  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](/web-hosting/files-and-access/secure-shell-ssh-overview).
</Note>

## Deploying on push

cPanel supports push-to-deploy with a .cpanel.yml file in the repository root:

```yaml theme={null}
---
deployment:
  tasks:
    - export DEPLOYPATH=/home/username/public_html/
    - /bin/cp -R * $DEPLOYPATH
```

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)

<Tip>
  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.
</Tip>
