Github 101 : Initial Setup and SSH

...

Tapan Patel

2023-01-15

Github 101 : Initial Setup and SSH

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.). explorer_nSHfbMjOtb.png

Copy the public key

Let's copy the all the content of .pub file as it is. Notepad_3U9ySjw8l9.png

Part - II : Github

Login into your github account, on the right top corner, click on your profile, click on the settings option. msedge_VEVBYYjxwu.png

Next, on the left navigation panel, click on the SSH and GPG Keys. msedge_Stb1PtJVmT.png

You'll find the Add ssh key, give a name to your key, and paste the public key that you copied from .pub file. msedge_Zev8KRdPRu.png

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.