Skip to content

Instantly share code, notes, and snippets.

@melbourne2991
Last active January 3, 2019 11:45
Show Gist options
  • Save melbourne2991/5057219dd9bf368f7c85429d21f9af7a to your computer and use it in GitHub Desktop.
Save melbourne2991/5057219dd9bf368f7c85429d21f9af7a to your computer and use it in GitHub Desktop.
Git SSH Key Setup
  1. Generate a key in ~/.ssh with ssh-keygen
  2. Go to gitlab/github and add the public key.
  3. Update or add the ~/.ssh/config file with:
Host gitlab.com:username
  IdentityFile /home/user/.ssh/gitlab

Host github.com:username
  IdentityFile /home/user/.ssh/github
  1. eval $(ssh-agent)
  2. ssh-add ~/.ssh/gitlab
  3. Push!

-- On osx easy copying of keys: cat gitlab.pub | pbcopy

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