How to setup SSH key for Git.

A Aditya
2 min readNov 23, 2022

--

A step-by-step guide to setup your SSH key for Git.

This guide will help you create an SSH for Git. This is an alternative to entering password every time you push or pull from a repository.

Photo by Pankaj Patel on Unsplash

Step 1 : Go to Git — Downloading Package (git-scm.com)

Step 2 : Download the git setup for your system. While downloading the packages check your Operating System and Version.

Step 3 : Open the Installer and click next untill install button appears then click and install git into your computer.(In the last step select the launch Git Bash option)

Step 4 : A terminal for git will open (Tip: you can use this terminal as you use your windows terminal with one advantage that the Git Bash uses the linux commands, I personally use this for my everyday work)

Step 5: Check whether Git is successfully installed. To check Type in the command :

git --version

Step 6 : Then enter the following commands:

git config --global user.name "Your Name"

git config --global user.email "Your Email"

Step 7 : Now let us generate our SSH Key.To generate SSH key type:

ssh-keygen

Step 8: Now you will be asked for the location to store your SSH Keys. Your PC will have a .ssh folder by default. Leave it as it is. Press enter

Step 9: Next you will be asked to enter a password, note that you will be asked to enter this password all the time so I recommend you keep it simple and easy to remember.

Step 10: Your Private/Public Keys have been created.

Step 11: When you open your .ssh folder, you will see:

a. id_rsa: This is your private key

b. id_rsa.pub: This is your public key

Step 12: Now enter command:

cat your path to .ssh folder/id_rsa.pub
This will display a string starting with ssh-rsa

Step 13: Go to https://github.com/settings/ssh/new and paste the string found in the previous step.

Step 14: You are now set to use your SSH Key with Git.

You are now set to clone your repositories using SSH. If you were able to follow and succesfully setup your SSH Key. Consider giving me a clap. Thanks.

--

--

A Aditya

Just a random guy sharing his experience and knowledge about Technology and FInance.