Clone Private Github Repository Files Inside Live Website With CPANEL & Git Version Control | SSH
HTML-код
- Опубликовано: 9 фев 2025
- We shall pull the files from private github repository to a live website by following the steps which are shown in the video.
-------------------------------
Putty:- www.putty.org/
SSH Keygen command:-
ssh-keygen -t rsa -b 4096 -C "username@servername"
Subscribe my Channel:- www.youtube.com...
Facebook Page:- / unpossiblens
Twitter Account:- / unpossiblepog
Blog :- unpossiblepog....
-------------------------------
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.
In double quote, type username@servername.
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.
Just what I needed, thank you!
Thank you very much, I've spent few hours trying to do that!
thanks a lot it worked forme :D
man you're awesome!! thanks so much😉
How can we do it for automatic push using post-receive hook?
Would be nice
work like charming! thanks for the video brother
Dear bro so much love from mine
Thank you ! Helped me a lot after hours of struggling ;)
very helpful thank you so much!
Thanks a lot ❤
the upload from remote in cpanel, can we make it automatic after a push to the branch linked to the cpanel
Thanks bro, It was so helpful for me
Thank you bro, you made my work easier :)
Enjoy
Perfect demo!
Thank you so much!!! YOU made my day...
thank you so much
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. "
Did you find any resolution?
@@finding_inner_self No
You can find in the cpanel documentation, because new commands were added
dont use passphrase
Whats putty and why do we need it?
Thank you so much, u saved me.
Не за что
I am getting this error on cpanel while creating clone
Error: (XID zrthux) “/usr/local/cpanel/3rdparty/bin/git” 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
Check the SSH access is enabled & folder name where you want to clone. And if the folder exists, then make sure that it is empty.
GitHub not accepting rsa/dsa keys anymore could be one reason. You may have to ssh into your server and create a key using "ssh-keygen -t ecdsa"
@@michaszymulanski23 I LOVE YOU I LOVE YOU I LOVE YOU I LOVE YOU. Genius
dont use passphrase
@@michaszymulanski23 god bless you
Very nicely done.
Kindly help, i keep getting this error on the cpanel
Error: (XID yraekc) “/usr/local/cpanel/3rdparty/bin/git” 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.
dont use passphrase
thank you very much !!
where can I find servername like this? is it anything special?
Thanks bro.
how to access this in browser?
how to change the default name from id_rsa to id_rsa_test or something like that..btw thank you for the tutorial..
While you want to create keys in putty command prompt, it asks for name, type name there
@@UnpossiblePOG please make video for that i really appreciate..
It does not work for me with bluehost hosting
Have you checked SSH access?
Network Error Connection Refused
Send me error's screenshot on facebook page's message box
Find out which PORT number has SSH access. Stop the video at 00:21 . You will see the PORT NUMBER allocated for your domain.