How to use a different email address in Git in sub directories
Estimated 1 minute read · Wednesday, 19 January 2022
I want to override my personal email address I use for Git with my work email address in my work directory without manually changing it each time.
# any customization/overrides can be added here [user] name = Clarice Bouwer email = firstname.lastname@example.org ```
[includeIf "gitdir:~/path/to/work/directory/"] path = ~/path/to/work/directory/.gitconfig
cd ~/ git config user.email # should be your default config email cd ~/path/to/work/directory git config user.email # should be your override email