SSH (Secure Shell) is used for more secure access between two parties. ssh is a password-less communication.There are two keys generated, private key & public key. The public key can be shared to other parties. Though the private key should be kept secret. If you know about cryptography then it would be easy to understand the concept fully. You can watch nasser hussian’s video to get some understanding. Though it's not required to fully understand the concept.
(Step confirmed working on Linux)
Open the terminal in root directory
in your terminal to check if there are any ssh present.
To create one type
ssh-keygen -t rsa -b 2048 -C ''Youremail@address''
It will prompt you to provide the location where the ssh file is to be created press enter to keep default location.
You can add a password for your file, to skip just press enter.
Now again if you again type command
You may get something like this
The id_rsa.pub is the public key
cd .ssh && cat id_rsa.pub
to see the public key
Now copy the key and paste it into https://github.com/settings/ssh/new
Now select any repository that you want to clone locally.
You will find an option to select the ssh link for the repo
The next steps are
git clone email@example.com:organization-name/respo-name.git
(be sure to use the device from which the ssh keys was generated)
Now you have successfully set up ssh.
What if you already have repository in your local using http
First open the terminal from the root directory of your repository.
You could check your remote git url using
git remote -v
Now to set the ssh url can do
git remote set-url origin firstname.lastname@example.org:organization-name/respo-name.git
Now after this you could do all push pull normally as you would do.