Skip to content

Instantly share code, notes, and snippets.

@chi-feng
Created January 9, 2020 21:59
Show Gist options
  • Save chi-feng/a091b53a92a888f5ac77df739bdcac5a to your computer and use it in GitHub Desktop.
Save chi-feng/a091b53a92a888f5ac77df739bdcac5a to your computer and use it in GitHub Desktop.
github ssh auth
  1. run ssh-keygen and press enter repeatedly until done. This creates a public/private key pair in ~/.ssh/
  2. run cat ~/.ssh/id_rsa.pub to print out the public key
  3. copy the key to your clipboard
  4. visit https://github.com/settings/keys and click [New SSH key] and paste your key when prompted
  5. You're done!

Now you can git clone via ssh (make sure to copy the repository url for cloning using SSH instead of HTTPS). The repository url should look like: git@github.com:user/repo.git

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