Clone Private Github Repository Files Inside Live Website With CPANEL & Git Version Control | SSH

preview_player
Показать описание
We shall pull the files from private github repository to a live website by following the steps which are shown in the video.
-------------------------------

SSH Keygen command:-

-------------------------------
In this video, we shall make a connection between private github repository and live cpanel.
First you must have a domain with cpanel and a github account.
I purchased a domain+cpanel from godaddy. You can choose your own hosting providers but make sure that the SSH access is enabled. For godaddy users, here is the path to find and enable SSH access.
Next, open github, login into your account, or create account if you don’t have one.
Click on plus icon which is before your profile pic, click on new repository.
Give any random name.
You can make repository as private from here or if you forgot to make it private, you can make it afterward.
Just go to settings tab, scroll down, you will see, “Change repository visibility”, click on a button in front of it and can click on private and save it.
Now, login into your domain’s cpanel.
Then open PUTTY. If you don’t have it, download link is given in the description. Install it.
Now copy the IP address from cpanel dashboard.
Paste it in HOST NAME textbox, make sure that the SSH radio button is selected, then click on OPEN.
It will open a command prompt.
Type the username which you use for login into cpanel.
Hit enter.
Now type the cpanel’s login password.
When you type the password, it will not show anything on command prompt, but whatever you are typing is getting stored in the background.
Once you logged in, you will see something like this.
Once connected, you will have to type the command to create public and private key.
It will be given in the description.
Keep the filename & passphrase empty.
Now, go to cpanel and SSH ACCESS : MANAGE SSH KEYS.
You will see the newly created keys there.
Click on MANAGE of the public key, AUTHORIZE it.
Let’s jump to github, open your repository and click on settings tab, then DEPLOY KEYS. Then ADD DEPLOY KEY.
Give any key name.
For public key, go to cpanel, and click on VIEW/DOWNLOAD link in front of public key.
Copy it from start to end and paste it in github’s key textarea.
Check the ALLOW WRITE ACCESS, Of course we already can download files from github to cpanel by default. But giving the WRITE ACCESS means, you can upload changes from cpanel to github.
Once done, open the putty command prompt, type the following command to check if the domain can be connected to github or not.
Now we are successfully authenticated.
From github, lets create a new file. Type anything there. Give it any random name.
Scroll down and commit the change.
You will have a new file in your repository.
Go to cpanel dashboard, click on git version control, then CREATE.
Now open github, click on code, then click on SSH tab, copy the text from the textbox.
Paste it in CLONE URL textbox of cpanel.
For repository path, you can not add those folders which not empty.
For example if I add public_html folder which already has so many files and try to clone it, it will give me an error.
So you can either empty the public_html folder or create a new empty folder which is what I am going to do.
Now you can create a clone of private github repository.
You will be redirected to GIT repository listing. Click on the MANAGE button.
And click on PULL OR DEPLOY.
You will see that those UPDATE AND DEPLOY buttons are disabled.
First, lets check if our original file is copied to our website’s directory by going to the FILE MANAGER.
The file is there and it contains the text that we typed.
Let’s do some changes in github file and try to reflect it to our live site.
To synchronize or pull the changes, lets go to CPANEL’s dashboard : Git version control : MANAGE : PULL OR DEPLOY and click on UPDATE FROM REMOTE.
Lets again go to file manager, and view the file.
Changes are reflected there.
So that is it, thanks for watching. Like share and subscribe.
Рекомендации по теме
Комментарии
Автор

Thank you very much, I've spent few hours trying to do that!

eudanilolira
Автор

Thank you ! Helped me a lot after hours of struggling ;)

nicolasl
Автор

How can we do it for automatic push using post-receive hook?

khnaz
Автор

work like charming! thanks for the video brother

rahmatdicky
Автор

man you're awesome!! thanks so much😉

millionaire
Автор

Thank you bro, you made my work easier :)

antonyjasper
Автор

Thank you so much!!! YOU made my day...

parastewari
Автор

I am getting this error
"Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. "

soorajking
Автор

the upload from remote in cpanel, can we make it automatic after a push to the branch linked to the cpanel

hassanbelmekki
Автор

I am getting this error on cpanel while creating clone

Error: (XID zrthux) reported error code “128” when it ended: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists

maheshmahadar
Автор

Kindly help, i keep getting this error on the cpanel

Error: (XID yraekc) reported error code “128” when it ended: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

akerelejohn
Автор

where can I find servername like this? is it anything special?

vinit
Автор

how to change the default name from id_rsa to id_rsa_test or something like that..btw thank you for the tutorial..

dxlift
Автор

It does not work for me with bluehost hosting

aymenmohammed