Skip to content

Instantly share code, notes, and snippets.

@stevenh512
Created June 11, 2012 10:51
Show Gist options
  • Star 50 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save stevenh512/2909546 to your computer and use it in GitHub Desktop.
Save stevenh512/2909546 to your computer and use it in GitHub Desktop.
URL rewriting in .gitconfig
# Use git and git+ssh instead of https
[url "git://github.com/"]
insteadOf = https://github.com/
[url "git@github.com:"]
pushInsteadOf = "git://github.com/"
[url "git@github.com:"]
pushInsteadOf = "https://github.com/"
# Use https instead of git and git+ssh
[url "https://github.com/"]
insteadOf = git://github.com/
[url "https://github.com/"]
insteadOf = git@github.com:
@stevenh512
Copy link
Author

If you're behind a firewall, on a slow internet connection or have some other reason to _always_ use https (or git+ssh), append one of these to your .gitconfig and you're good to go. 😁

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