Using SSH on Mac OSx for Github

Wednesday, August 17, 2016 Unknown 0 Comments

I wanted to write a post about something that I thought was simply too complicated, but was pretty straight forward. Documentation here. If you wanted to git push a commit to your repo, and you're using SSH. This is typically something like
git@github.com:USERNAME/FILENAME.git
But while trying to push you get something like:
Permission denied (publickey).fatal: Could not read from remote repository.
Please make sure you have the correct access rights 
So what you need to do to fix this.
  1. Create your own SSH public key. You will do this in your own computer using the command line. Please read the directions here: https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key
  2. Add your SSH public key to github. Log into your github profile, and under your profile go to settings. Select SSH and GPG keys, and from there click on New SSH Key
  3. Git working! Now you can git commit or git push no problem.

Add SSH public key to github