However, this doesn't work well with git submodules, because then everyone cloning the repo must recreate this config.
(Just something to be aware of.)
The custom hostname will be replaced transparantly for you and won't need to make it into gitmodules.
# ~/.config/git/config
# Only for single user/org
[url "git@github_ssh:foo"]
insteadOf = "git@github.com:foo"
# all the things
[url "git@github_ssh"]
insteadOf = "git@github.com"
Similar pattern if you want to force-use ssh instead of https or vice-versa.
The custom hostname will be replaced transparantly for you and won't need to make it into gitmodules.
Similar pattern if you want to force-use ssh instead of https or vice-versa.