Git can change configuration depending on the directory you're in. By using this feature, you can create a directory structure with context-aware Git configurations.
Using includeIf in ~/.gitconfig:[include] "~/.config/git/main.gitconfig" [includeIf "gitdir:~/work/companyA/**"] "~/.config/git/companyA.gitconfig" [includeIf "gitdir:~/work/companyB/**"] "~/.config/git/companyB.gitconfig"
Here we everything under ~/work/companyA/ will get the git configuration from ~/.config/git/companyA.gitconfig, and similarly for companyB.Identity