Last active
November 18, 2024 08:50
-
-
Save taoyuan/bfa3ff87e4b5611b5cbe to your computer and use it in GitHub Desktop.
Force git to use https:// instead of git://
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# npm using https for git | |
git config --global url."https://github.com/".insteadOf [email protected]: | |
git config --global url."https://".insteadOf git:// | |
# npm using git for https | |
git config --global url."[email protected]:".insteadOf https://github.com/ | |
git config --global url."git://".insteadOf https:// |
@joseboretto
Bro, you saved me headache. Thanks.
Thank you!! You just saved my life.
All the yes. Thank you !
This worked like a charm 🥇
When using ssh (git config --global url."[email protected]:".insteadOf https://github.com), is there a way to authenticate (using A PAT)? I know it's possible with https, don't see a way to provide a PAT (via Github secret) when using SSH method.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If anyone found themselves unable to revert the config using the suggested commands, go into the git config editor and manually delete what you want to remove :)
git config --global -e
For anyone unfamiliar with the editor, press "i" to start editing, "esc" to stop editing, and " : -> w -> q " to save and quit the editor.