Git in cPanel: clone and deploy a site
- Open "Git Version Control" (group "Files").
- Click "Create".

- Keep "Clone a Repository" on.
- "Clone URL" - the https address of the repository, for example
https://github.com/user/my-site.git. - "Repository Path" - the folder for the repository, for example
repositories/my-site. - "Repository Name" - a name for the list.
- Click "Create".

A public repository clones over https with no setup. For a private one, put an access token in the URL: https://TOKEN@github.com/user/repo.git (on GitHub - a Personal access token with read access).
A private repository is easier to connect with a passphrase-less SSH key - see Private GitHub repository: deploy key.
Deploying to the site folder
To copy files from the repository to the site folder, put a .cpanel.yml file in the repository root:
---
deployment:
tasks:
- export DEPLOYPATH=/home/USERNAME/public_html/
- /bin/cp -R * $DEPLOYPATHTo update: "Manage" the repository - "Pull or Deploy" tab, buttons "Update from Remote" (fetch changes) and "Deploy HEAD Commit" (deploy).
Do not clone the repository straight into public_html if it contains files with passwords or a .git folder - they could be downloaded.