Skip to content

Git: globally change GitHub-remotes from git@ to https

github logo ・1 min read  

Setting upstreams

Are you finding yourself using git remote --add --push-commands not to actually change the location, but to fix authentication problems with GitHub arising from using ssh instead of https? There is a simple solution.

The format of the ssh-url is{userOrOrg}/{repoName}.git, while we want it to be{userOrOrg}/{repoName}.git

That is very predictable, so you can run the following command:

git config --global url."".insteadOf

Note the trailing slash as well as the colon!

Yes, that simple!

That's it. You can verify (and change) the setting by inspecting the global configuration:

git config --global --edit

twitter logo DISCUSS
Classic DEV Post from Feb 12

Five Myths of Salary Negotiation

In this video I debunk five negotiation myths that I've seen personally and from talking with candida...

neoan profile image
Hello! I am a full stack web dev with roots in LAMP but hack away in Node-environments as well; explore in rust; thrive in open source

Still don't have a account? You're welcome to lurk, but it's better to be part of the community.

Sign up now ❀️