Showing posts with label GIT. Show all posts
Showing posts with label GIT. Show all posts

Sunday, 28 June 2020

GIT Version Control in Cpanel

Now in this modern age, everyone will be working through cloud for their projects. And mostly all will be using Git for cloning, forking projects and do updates. So am just trying explain how we can configure it in a cpanel. When am writing this, Iam of the consideration that, you will be having a valid github account, created your project repository in it.

Mostly We can create Github repositories as public and private. For public repositories, the git cloning will go smooth. But for Private projects we have to do some terminal operations to generate ssh keys for doing it.

STEPS

1) In Your Cpanel You should be having a Terminal Access. Make sure you have , talk with your server administrators for having it. You can create ssh key through interface also, but for this case, you will be needing the terminal.

2) In the Terminal , Just type like this:-

ssh-keygen -t rsa -b 4096 -C "username@domain.com"

Make sure the bit is 4096. and  username you can replace it with your cpanel username and domain.com, replace it with your domain name. 

3)After you run this command, the system will prompt you to enter a passphrase. Do not enter a passphrase, and press Enter to continue.

4)Now key will be generated in the system. so Inorder to make sure that, its generated. run this:-

cat ~/.ssh/id_rsa.pub


5) Now you will get an output like:-

ssh-rsa AAAAB3Nzawhdejsfdjhfgdjgfhjfdghjfhgjhjfdhgdfjhgjudfhgjikgfhgfhgfhfghhgfhgfhgfhgfhhgfhasftfgegdggdgdgd...
Copy this and store it somehere. These is your key.

6) Now we have to register key in Github.  For that go to the repository.click settings. and click on Deploy Keys menu.



7) You will see an Add Deploy Key option like this:-

8)After, clicking you will get a form like this:-


8)In the Title text box, enter a display name for the key.

9)In the Key text box, paste the entire SSH key.

10) If you want to push code from your cPanel account to your GitHub account, select the Allow write access checkbox.

11) Now in your cpanel, Go to GIT version control page. 

12) In the page coming, click on create button shown on the right side:-

13) Now a create page will come like this:-

In Clone  URL, enter the SSH details instead of https. That you can get from :-

repository path you can set to the domain directory u want to clone. and give a repository name for identification. Then click on create. Your repository will be successfuly created.

14) Now you can manage, the repository by visiting the git list.


After syncing..may be sometimes you dont want the connection setting files to upload everytime.. so after adding files to gitignore you can perform a command like:-

git rm -r --cached . && git add . && git commit -am "Remove ignored files"
or step by step
git rm -r --cached . 
git add .
git commit -am "Remove ignored files"

Enjoy Coding :-)



Thursday, 11 June 2020

Uploading Large Size Files to GITHUB through git

In Girhub , there is a limitation as users cannot upload files more than 25 mb. So in this cases we have to upload it through GIT. 
For windows you can download GIT by going to this URL;  https://git-scm.com/download/win.

After installing GIT. Open GIT GUI and create a repository.

Then select the folder where your project is lying

Click on Create, then a window will be opened same like this:-


Click on GIT Bash, You will get a terminal screen .Now we have to go to the github site and copy the repository which we want to commit the updates or upload files. So go the repository and copy the Url like this.