Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save isaac-souza/ef6897ab3abca1702e34ddc6dfbc59fc to your computer and use it in GitHub Desktop.
Save isaac-souza/ef6897ab3abca1702e34ddc6dfbc59fc to your computer and use it in GitHub Desktop.
If 2fa is enabled on github switch to ssh instead of https on linux
1. generate an ssh keypair on your linux box
ssh-keygen -t {rsa|dsa}
2. add the public key to github: profile - settings - ssh keys
3. switch from https to ssh
Check your repo remote:
git remote -v
should show:
origin https://github.com/USERNAME/REPOSITORY.git (fetch)
origin https://github.com/USERNAME/REPOSITORY.git (push)
Change the remote:
git remote set-url origin git@github.com:USERNAME/OTHERREPOSITORY.git
verify:
git remote -v
should show:
origin git@github.com:USERNAME/OTHERREPOSITORY.git (fetch)
origin git@github.com:USERNAME/OTHERREPOSITORY.git (push)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment