Change Your Git User Depending on the Current Working Directory with Conditional Includes
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 <email@example.com> and switches to Vincent Adultman <firstname.lastname@example.org> 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="email@example.com"
# ~/.dotfiles/git/private.gituser [user] name="Vincent Adultman" email="firstname.lastname@example.org"