Generally, I want my commits to use “firstname.lastname@example.org”.
Not for work, though. For those, I want to be “email@example.com”.
[user] email = firstname.lastname@example.org
[user] name = Your Name email = email@example.com [includeif "gitdir:~/work-stuff/"] path = .gitconfig-work
The global config is used generally. A conditional include is used when the directory matches, overwriting/augmenting values in the default config.
Now, based on the directory, git config will return different values, keeping my silly personal identity out of professional commit logs.