Prerequites
- GitHub account
- Mac/Windows/Linux
Creating SSH key:
Open terminal on your machine,
PS C:\Users\tapan> ssh-keygen -o -t rsa -C "emailforgithub@email.com"
You'll be asked for location, specify the location, or just hit enter. Next, you will be asked for paraphrase, just hit enter and confirm it again. If, everything goes well, you will see a pattern for your key.
Next, open the location, where you generated the key (For windows, C:\Users\tapan/.ssh/id_rsa is the default location.).
Copy the public key
Let's copy the all the content of .pub file as it is.
Part - II : Github
Login into your github account, on the right top corner, click on your profile, click on the settings option.
Next, on the left navigation panel, click on the SSH and GPG Keys.
You'll find the Add ssh key, give a name to your key, and paste the public key that you copied from .pub file.
Last thing last
Open, your terminal and run two cmds:
PS C:\Users\tapan> git config --global user.email "tapan2930@gmail.com"
PS C:\Users\tapan> git config --global user.name "Tapan Patel"
Note: remove --global for a single repo.