If you work on different projects with the same computer, you can define different Git “profiles” with their own git configurations and emails by adding includeIf clauses in your global .gitconfig file

[includeIf "gitdir:~/projects/work"]
	path = ~/projects/work/.gitconfig
	email = me@work.com
 
[includeIf "gitdir:~/projects/oss"]
	path = ~/projects/oss/.gitconfig
	email = my@personal.email