# Deploying GitHub Repositories with cPanel Git™ Version Control

https://www.bihostnet.com/en/knowledgebase/article/cpanel-git-version-control-github-integration

## What is cPanel Git™ Version Control?

cPanel provides a native graphical interface to clone, track, and deploy code from Git repositories (GitHub, GitLab, Bitbucket) directly into your hosting directory.

## Configuring SSH Deploy Keys for Private Repositories

1. In cPanel, open **SSH Access > Manage SSH Keys > Generate a New Key**.
2. View and copy the generated **Public Key**.
3. In GitHub, go to your repository: **Settings > Deploy Keys > Add Deploy Key** and paste the key.

## Cloning the Repository

1. Open **Git™ Version Control** in cPanel and click **Create**.
2. Provide the Git SSH clone URL and specify your destination path.
3. Click **Create** to complete the initial clone.

## Automating Deployment with .cpanel.yml

Include a `.cpanel.yml` file in your repo root to copy files to `public_html` upon pulling changes:

```
---
deployment:
  tasks:
    - export DEPLOYPATH=/home/username/public_html/
    - /bin/cp -R * $DEPLOYPATH
```
