by darkr · 3y ago · 0 comments
[includeIf "gitdir:~/work/client1/"]
path = ~/work/client1/.gitconfig
[includeIf "gitdir:~/work/client2/"]
path = ~/work/client2/.gitconfig [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...
I create a top level directory for collection of related repositories. It lets me configure git for different collection of repositories.