Re:Use multiple Git SSH identities on a single computer
by darkr on Thursday July 20, 2023 @07:15AM
(#36798978)
I manage this with conditional includes in ~/.gitconfig:
[ Parent
| on HN ]
Re:Use multiple Git SSH identities on a single computer
by perdjesk on Thursday July 20, 2023 @08:48AM
(#36799693)
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
[1] https://git-scm.com/docs/git-config#Documentation/git-config...
Re:Use multiple Git SSH identities on a single computer
by mechanicker on Thursday July 20, 2023 @09:16AM
(#36799999)
This is the approach that finally worked for me and have been using this for past 4 years.
I create a top level directory for collection of related repositories. It lets me configure git for different collection of repositories.