5 ms·
includeIf directive supports as well conditions based on configured remote URL. [1] [includeIf "hasconfig:remote.*.url:https://client1domain.com/**"] pat
by perdjesk 3y ago
includeIf directive supports as well conditions based on configured remote URL. [1]
[includeIf "hasconfig:remote.*.url:https://client1domain.com/**"]
path = ~/work/client1/.gitconfig
[includeIf "hasconfig:remote.*.url:https://client2domain.com/**"]
path = ~/work/client2/.gitconfig
Check comment [2] for a complete example with pinning SSH key and signing key using git-config.
[1] https://git-scm.com/docs/git-config#Documentation/git-config.txt-codehasconfigremoteurlcode https://git-scm.com/docs/git-config#Documentation/git-config...
[2] https://news.ycombinator.com/item?id=36800853 https://news.ycombinator.com/item?id=36800853