To work with multiple emails, use conditional includes.
https://stackoverflow.com/questions/4220416/can-i-specify-multiple-users-for-myself-in-gitconfig https://git-scm.com/docs/git-config#_conditional_includes
- Uncomment the following section, and substitute “work” for whatever the name of company’s work folder you want.
[user]
name = Fernando Costa Bertoldi
email = [email protected]
[includeIf "gitdir:~/work/"]
path = config-work
- In the file ~/.config/git/config-work, add the work specific config:
[user]
email = [email protected]