GPG vs SSH keys

Domenick picture Domenick · Jul 19, 2018 · Viewed 20.7k times · Source

On GitHub, I want to add a key to associate my computer with my account and I am given two options: create an SSH or a GPG key.

What is the difference between the two keys? and is there a preferred one to use?
I understand how to create both by following the guide on the site but I don't know which one is better to use.

Answer

VonC picture VonC · Jul 19, 2018

I want to add a key to associate my computer with my account and I am given two options

You will need at least the SSH one, if you want to push back to your repository, using an SSH URL (since the public SSH key will authenticate you).
Start with SSH. See "Connecting to GitHub with SSH".

Later, you can use GPG to sign commits.