cPanel, Git integration with cPanel
In version 72 and later, cPanel offers Git integration through the web interface.
When connecting to your cPanel-hosted git repo from your local machine, you will need to configure your local machine to use your ssh key with git. If you are using a graphical git client or file manager extension, review the documentation for your software. One example for using your cPanel-hosted repo from a linux command line on your local machine is below. There are many other ways to do this, so feel free to use whatever method works best for you.
- edit the file ~/.ssh/config to add a configuration for your cPanel account
If the file does not exist, create it
enter the following lines into the file, replacing "cpanelaccountname" with the actual name of your cpanel account and "sshprivatekeyname" with the name of your private ssh key (id_rsa by default)
- Clone your cPanel-hosted repo to your local machine
From your local machine, run
- if your key had a passphrase, enter the passphrase when prompted
- If you get an error message, read it and take the recommended action. The most common error is that the ssh keyfile has permissions that are too open
- From here, you can use whatever git commands fit into your workflow without modification