Monday 5 July 2021

Upload Files From Local Machine To CPANEL | Bad Config Value For receive.denycurrentbranch Solution | Git & GIT VERSION CONTROL




Upload files from Local Computer to CPANEL’s file manager using git version control.
-------------------------------
SSH Key generation command:-
ssh-keygen -t rsa -b 4096 -C "your_email_id"

BASHRC File code:-
export PATH=/usr/local/cpanel/3rdparty/lib/path-bin:$PATH

Subscribe my Channel:- 
http://www.youtube.com/user/SanketRooney?sub_confirmation=1 

Facebook Page:- 
https://www.facebook.com/UnpossibleNS 

Twitter Account:- 
https://twitter.com/UnpossiblePOG 

Blog:- 
https://unpossiblepog.blogspot.com/ 

Website:- 
https://unpossiblepog.com/ 

Gaming Instagram:- (@unpossiblepoggaming)
https://www.instagram.com/unpossiblepoggaming/
-------------------------------
Hello guys, in this video we shall upload files from LOCAL COMPUTER to domain’s CPANEL using git and git version control.
There are 2 requirements to complete this task.
1st, , make sure that you have SSH access is enabled on your domain. In my case as I purchased it from godaddy, so there is a setting for it.
Also I do have CPANEL access of it. Make sure that it has git version control enabled.
2nd requirement is have GIT installed on your computer. 
Now in command prompt, notice that this is the default location, which is C drive, USERS folder and then the username.
Copy the command that is provided in the description of the video, paste it in command prompt.
Type your email address inside double quote.
It will create a public-private keys.
Do no add any text, leave them empty by pressing ENTER button of your keyboard.
Now go to this location.
There will be a “.ssh” folder, if there is not, it will be hidden. Go to settings and make it visible.
Now go inside ssh folder, and there you will see the file with an extension as “.pub” which means the public key.
Open it in text editor like notepad or anything.
Copy it and go to CPANEL of your domain, go to SSH ACCESS option, click on “IMPORT KEY”, give any random name.
Leave private key and passphrase empty. 
In PUBLIC KEY TEXTAREA, paste that public key.
Click on IMPORT.
Now authorize that newly added key.
Let’s go to CPANEL dashboard, click on GIT VERSION CONTROL.
Click on create, uncheck the “CLONE REPOSITORY” option.
I shall add file name which will automatically create a new folder in cpanel.
Now, go back to the listing, click on MANAGE button in front of newly created repository, and copy the CLONE URL.
Now, on your computer, choose any location, create a folder there.
Open that folder in GIT BASH.
Type command “git clone”, then paste the path, and then give any random name to it. I gave it a name as “testing”.
If it asks question, type YES.
Of course our repository is empty so ignore the warning.
Let’s create idex.html file there, open it in text-editor.
Type something inside it.
Let’s add that in change list.
My mistake, you have to go inside that testing folder so use the CD command to enter inside it.
Now, we are inside testing folder.
Let’s run commands to upload those files.
Now, before pushing files to CPANEL, check the available branches.
We have one available known as “refs/heads/master”.
Lets push file inside it.
There is one error called “bad config value for ‘receive.denycurrentbranch’ in ./config”.
To solve that, go to FILE MANAGER of cpanel, go to settings and make sure that “show hidden files” is checked. Save settings.
Search file “.bashrc”. Let’s edit that page.
On top of file, paste the following code that I provided in the description.
Save it.
Now, let’s run that command again.
Let’s check if changes are reflected.
As you can see, there is an index.html file and it has the text that we typed.
Let’s make more changes. Save them.
And, those changes are reflected.
So that is it, thanks for watching. Like share and subscribe.

No comments:

Post a Comment