I have a work computer, and it\'s configured globally to use my work email and name when committing. This is good. However, I\'d like to make some sort of rule that says, \"if t
Git 2.13 adds support for conditional config includes. If you organize your checkouts into directories for each domain of work, then you can add custom settings based on where the checkouts are. In your global git config:
[includeIf "gitdir:code/work/"]
path = /Users/self/code/work/.gitconfig
And then in ~/code/work/.gitconfig:
[user]
email = self@work.com
And of course you can do that for as many domains of work as you like.