Skip to content

Instantly share code, notes, and snippets.

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 BodhiHu/dec5b4d56c6871fbe889b85c77d354e3 to your computer and use it in GitHub Desktop.
Save BodhiHu/dec5b4d56c6871fbe889b85c77d354e3 to your computer and use it in GitHub Desktop.
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@BodhiHu
Copy link
Author

BodhiHu commented Jul 30, 2021

the inverse, force using ssh (git@) instead of https:

git config --global url."git@github.com:".insteadOf "https://github.com/"

unset:

git config --global --unset-all url.https://github.com/.insteadof
git config --global --unset-all url.https://.insteadof

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