How to switch local Github repositories from HTTPS to SSH keys – 2020

Easy!

Assuming you’ve already configured an SSH key and added it to your Github account, if not  just follow this guide – https://help.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh

Once you’ve got an SSH key set up for Github and you want to switch ALL your repos to SSH, ust use this command:

git config --global url."[email protected]:".insteadOf "https://github.com/"

If you only want to switch one repo, just remove the –global flag and it’ll change just the local repo’s git config.

Leave a Reply

You are currently viewing How to switch local Github repositories from HTTPS to SSH keys – 2020