Clonning Repository from Github to Local Machine (Linux/Ubuntu) AWS EC2 Instance.

In Devops Culture it is manditory to be familiar with git & github concepts like Branching Stratagies,Git Version Cantrol System,Init, pull, push, commit, add, cherry-picking,(Git reset hard ,soft), Git Log, Stash, Merging, Collabarations, Token Generation, SSH key Setup in github, Forking ther repositories etc.

Keeping in mind following is a artical on clonning repository from github to local by creating or generating the public key and private key in local Machine.

Let's Get Started....!!!

Step 1:

Login to your aws ec2 ubuntu instance .

Create a Folder Named as: $mkdir Git-Ssh

Go inside the folder: $cd Git-Ssh

Initiate a empty git repository by: $Git init

now, com out of the folder Git-Ssh by: $cd ..

Go to .ssh folder by:- $cd .ssh

Generate a ssh key by applying command:- $ssh-keygen

Give the name to the key= Github_key

Note:- Dont give any extension to key like .pub or .ssh or any other just give simple name

check the key generated in .ssh folder or not by simply list command: $ls

you will get 2 key's as Github_key and Github-key.pub

Open Github_key.pub file By: $cat Github_key.pub

copy entire key by selecting and using ctrl c keys.

step2:

Open github account and go to profile,

in dropdown you will get settings option, click on it and open it.

At left hand side you will get a menu list with having option SSH AND GPG Keys

Click on it and open it,

Click on green button named as New ssh-Key and name your key with any name as you like i.e : shub'_key and paste your key in following description.

Click on Add ssh_keys.

Now we are done with ssh key setup.

now try to connect your local by cloning ssh repository

Step3:

Now, go to your any repository and copy ssh link.

Goto your local machine and $cd .ssh

now go to Git-Ssh Folder

$cd Git-Ssh

and try to clone by applying repo link as following example,

$git clone :Sagar9921/udemy-clone.git

Now you can check if your repository is linked or not by applying:

$ls

you will get a repository by name udemy-clone, if you are still having confusion you can go into the repository and check the file present in it by applying following command.

$cd udemy-clone

If your github is cloned with local machine then you are done with clonning.

Congratulations...!!!!!!!!!

If not cloned then try to resolve the errors, or you can contact me on linked in Sagar Chandgude.

Happy Learning

Learn Togrther Grow Together.

#trainwithshubham

Shubham Londhe