How to setup Git the proper way! — Part 2: Setting up SSH Key

Photo by Yancy Min on Unsplash

Before we start:

$ git --version

Generating SSH Keys

$ ssh-keygen -t ed25519 -C "your_email@example.com"
> Enter a file in which to save the key (/c/Users/you/.ssh/id_ed25519):[Press enter] 
> Enter passphrase (empty for no passphrase): [Type a passphrase]
> Enter same passphrase again: [Type passphrase again]

Adding the SSH key to Github

$ clip < ~/.ssh/id_ed25519.pub
$ pbcopy < ~/.ssh/id_ed25519.pub
$ xclip -selection clipboard < ~/.ssh/id_ed25519.pub

Configuring username and email

$ git config --global user.name "your_username"$ git config --global user.email "email@example.com"

Testing our SSH connection

$ ssh -T git@github.com
> The authenticity of host 'github.com (IP ADDRESS)' can't be established.
> RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
> Are you sure you want to continue connecting (yes/no)?
> Hi username! You've successfully authenticated, but GitHub does not provide shell access.
ssh link for cloning on github
ssh link for cloning on github

But:

Developer | Student | Techy

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store