It's possible to conditionally extend the git configuration based on where your repository is located in your file system. That means we can have a global git configuration with all the default configuration and then in a few overrides for all repositories within, for example, the ~/code/work/ folder by adding a little something like this to the ~/.gitconfig file.
via https://dev.to/tastefulelk/conditional-git-profile-configuration-212b
// ~/.gitconfig
[user]
name = Sebastian Bille
email = [email protected]