cPanel's Git Version Control lets you keep a Git repository on your hosting and deploy code from it.
SSH access is needed for pushing and pulling from your computer (see How to connect via SSH).
Create or clone a repository
- In cPanel, open Git Version Control in the Files section.
- Click Create.
- To copy an existing repository, leave Clone a Repository on and paste its clone URL (for example from GitHub). For a new, empty repository, switch it off.
- Set the Repository Path (for example
repositories/mysite) and a name. - Click Create.
Private GitHub/GitLab repositories need an SSH deploy key: generate one in SSH Access and add the public key to your repository's deploy keys.
Deploying
Keep the repository outside public_html and add a .cpanel.yml file to your repository to tell cPanel which files to copy into public_html. Then use Manage › Pull or Deploy › Deploy HEAD Commit.