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 <firstname.lastname@example.org> and switches to Vincent Adultman <email@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="firstname.lastname@example.org"
# ~/.dotfiles/git/private.gituser [user] name="Vincent Adultman" email="email@example.com"