Note: Replace all RED CAPITALIZED TEXT with your/your repository's information.
Navigate to SSH Access > Manage SSH Keys
Navigate to your Github > Repository > Settings
Navigate to your website's cPanel > File Manager
Navigate back to cPanel Terminal
Navigate to GitVersion Control
If using Github Desktop:
- In repository (header) > Repository > Repository Settings
- Remote > Primary Remote Repository (origin) URL
- Make sure that repository URL is HTTPS://
cPanel Version Control:
- Navigate to your website's cPanel
- Open Terminal in cPanel
- Enter these commands in the following order (ENTER after each):
ssh-keygen -t rsa -f ~/.ssh/KEYFILENAME -b 4096 -C "USERNAME@ROOT.DOMAIN"- KEYFILENAME can be anything. I advise making it similar if not identical to your repository name.
touch ~/.ssh/configchmod 0600 ~/.ssh/configchown USERNAME:USERNAME ~/.ssh/config
- REPOSITORY Key > Manage > Authorize
- REPOSITORY Key > View/Download > Copy key
- Deploy Keys > Add deploy key
- Title:
[anything] - Key: [paste from earlier ("copy key")]
- Allow write access
- Navigate to
.ssh(folder) >config(file) - Add to file:
Host REPOSITORY.github.com User git Hostname github.com IdentityFile ~/.ssh/KEYFILENAME IdentitiesOnly yes - Save and close
- Test if the repository works with
ssh -Tv git@REPOSITORY.github.com - If it outputs by saying
Hi REPOSITORY/USERNAMEthen it's successful. Don't worry about additional messages.
- Create the repository
- For the repository URL, make sure the format is:
ssh://REPOSITORY.github.com/USERNAME/REPOSITORY
Then you're done! All updates pulled from Github Version Control in cPanel should now work with your private repository :)