I do something similar, but instead of `insteadOf`, I just clone the repo with `gh-work:org/repo`, and in the git config: [includeIf "hasconfig:remote.*.url:gh-work:**/**"] path = ~/.gitconfig.d/gh-work.inc So, any git repo cloned with the ssh identity defined under `gh-work` will take on the config of `gh-work.inc`, which includes the git identity, and also the same signing key as in the ssh config. Essentially, the…
In my experience scripts that expect your remote to be a certain way will break with this approach.
I mean, it seems to me that any script that tries to do something with git remote URL, should deal with any string that git thinks is a valid remote URL. `ssh-host-name:owner/repo` is not exactly an edge case.