home

posts

notes

rss

git mailmap

I work on my Git repositories from different machines, which separates my contributions over different Git identities. Looking at all developers that contributed to one of my project’s repository, we get the following:

(base) pvdsp@laptop:~/git/⋯$ git shortlog -sne
71 Patrick Van der Spiegel <pvdsp@⋯.be>
58 Patrick Van der Spiegel <patrick@⋯.com>

Adding a .mailmap file to the root directory of the repository — following the Proper Name <[email protected]> <[email protected]> structure — fixes this issue:

Patrick Van der Spiegel <pvdsp@⋯.be> <patrick@⋯.com>
(base) pvdsp@laptop:~/git/⋯$ git shortlog -sne
129 Patrick Van der Spiegel <pvdsp@⋯.be>