cPanel, Git integration with cPanel
You have always been able to use Git with your cPanel account from the command line, but cPanel has also introduced a web-based integration with Git that gives you another option.
You can find it on your dashboard in the Files section.
To learn more, see this series of blog posts from cPanel explaining what git is, how the new integration works, and what's coming next.
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