Skip to content

Instantly share code, notes, and snippets.

@barnabyalter
Created January 4, 2016 16:46
Show Gist options
  • Save barnabyalter/8e430f3b090c8edcc92f to your computer and use it in GitHub Desktop.
Save barnabyalter/8e430f3b090c8edcc92f to your computer and use it in GitHub Desktop.
Connect a new computer to GitHub account

I've done this many times but every time I attempt to do it anew many months have passed and I always have to look it up again. Here is a quick reference for myself and others to do this quickly and easily.

Create SSH key

First create the ssh key on your local computer and copy to your clipboard:

~$ cd ~/.ssh && ssh-keygen
~$ cat id_rsa.pub | pbcopy

Add key to GitHub

Then in GitHub go to "Settings > SSH Keys > Add SSH Key," paste in the key and name is something appropriate so you can keep track of your keys.

Configure Git locally

~$ git config --global user.name 'My name'
~$ git config --global user.email myemail@host.co.uk

Thanks:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment