Skip to content

Instantly share code, notes, and snippets.

@letiesperon
Last active July 4, 2021 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save letiesperon/ce8217bc99195032f9dda3c67b424150 to your computer and use it in GitHub Desktop.
Save letiesperon/ce8217bc99195032f9dda3c67b424150 to your computer and use it in GitHub Desktop.
Configure git and github

How to link git to your github account in a new Mac OS

  • Generate new ssh key for your github email:
ssh-keygen -t rsa -b 4096 -C "your@email.com" 
// Intro to accept default directory, set an optional passphrase

eval "$(ssh-agent -s)"
  • Paste the following in vim ~/.ssh/config:
Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_rsa
  • Store the key and copy to clipboard:
ssh-add -K ~/.ssh/id_rsa 
pbcopy < ~/.ssh/id_rsa.pub
  • Go to Github / Settings / "Ssh and gpg keys" / "New ssh key":
  • Pick a name and paste the key that should be in the clipboard

Reference: Generate ssh key and Adding the new ssh key to github

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