One way to change the user.email git config value is to git config --local
in every repo, but that's tedious, error-prone and
doesn't scale very well with many repositories
(and the chances to forget to set the right one on a new repo are ~100\%).
The solution is to use the git-config ability to include
extra configuration files, based on the repo path, by using includeIf:
\vspace{1em}
Content of \texttt{\$HOME/.gitconfig} :
\begin{verbatim}
[user]
name = Sandro Tosi
email = <personal.address>@gmail.com
[includeIf "gitdir:~/deb/"]
path = ~/.gitconfig-deb
\end{verbatim}
Every time the git path is in ~/deb/ (which is where i have all Debian repos)
the file ~/.gitconfig-deb will be included; its content:
\begin{verbatim}
[user]
email = morph@debian.org
\end{verbatim}
That results in my personal address being used on all repos not part of Debian, where i use my Debian email address. This approach can be extended to every other git configuration values.