How to convert `git:` urls to `http:` urls

Here’s an example of rewriting the default protocol for GitHub:

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

The exact values depend on the protocol in use. For example, the above command for git over ssh will look like:

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

Git documentation for url.<base>.insteadOf:

git config [--global] url.<base>.insteadOf <other_url>

Any URL that starts with this value will be rewritten to start, instead, with <base>. When more than one insteadOf strings match a given URL, the longest match is used.

Leave a Comment