How to do SSH GitHub setup

less than 1 minute read

I have been using Git to manage this site’s development. I tried to push changes to origin/master via Sourcetree which didn’t occur successfully due to incomplete setup. I decided to use SSH to connect to GitHub. Comprehensive guide with reasoning can be found here.

tl;dr - I used the following commands:

ssh -T
ssh-keygen -t rsa -C ""
cd ~/.ssh
eval "$(ssh-agent -s)"
ssh-add id_rsa

I added the new SSH key to my GitHub account as shown here.

After this, I checked SourceTree’s Preferences to make sure the right settings were enabled, with the SSH key. I followed it up by converting the repository to SSH using SourceTree.