To add a Git repository on a hosting site, log in through cPanel server panel, and then go to Git Version control located in the Files section.
How do I configure the Git repository in cPanel?
- Log in to Your cPanel account.
- Navigate to Files section and "Git Version Control" will be available there.
- Click on the "Create" button.
- After the page has been reloaded, the following fields will be be filled.
- Clone URL - in this field You have to enter address of your repository (SSH key access configuration),
- Repository path - path to your repository on hosting account,
- Repository name - in this field you can name your repository,
- Click "Create" after fields are filled.
- On finish You will see page with repo list, that include added repository.
If you want to clone repository, that is accessed with SSH key, You must upload that key beforehand to server:
- Log in via FTP using main account data (FTP clients tutorials: WinSCP, Total Commander, CyberDuck, FileZilla).
- Create an
.sshdirectory (if it's not existing) with permissions of 700 (chmod; Full permissions for the user creating this directory).
- Check out tutorial: Generating SSH keys, if You didn't do that before.
id_rsafile that contains a private key to access the repository to the
.sshdirectory. The permission for this file after uploading should be 600 (chmod; read and write for the user who creates it). Additionally, the
id_rsafile should not have additional password protection.