When you own multiple git accounts (e.g. work for multiple companies) you probably don´t want to change your main config file.
In git you can include a config based on the directory where the repository is stored.
[includeIf "gitdir:/Users/YOUR_USER/Projects/[SPECIAL]/"]
path = ~/.git/.gitconfig-[SPECIAL]
And for all repositories under /Users/YOUR_USER/Projects/[SPECIAL]/
it will extend your main config with.gitconfig-special
which could look like this
[user]
name = Your Real Name
email = [email protected]
signingkey = SIGNING_KEY_ASSOCIATED_WITH_THIS_EMAIL_ADDRESS
P.S. this is also useful if you use another account e.g. for github
git — Mar 19, 2021