My Notes
Git 2.13+ introduced Conditional Includes which allow to set the Git user name depending on the Git repo location (and much more).
The following example defaults my Git user to Kevin <k@example.com> and switches to Vincent Adultman <va@example.com> if the repo is located in ~/job.
#~/.gitconfig
[include]
path = ~/.dotfiles/git/private.gituser
[includeIf "gitdir/i:~/job/"]
path = ~/.dotfiles/git/job.gituser
# ...
# ~/.dotfiles/git/job.gituser
[user]
name="Kevin"
email="k@example.com"
# ~/.dotfiles/git/private.gituser
[user]
name="Vincent Adultman"
email="va@example.com"