I have a repository shared with a contributor. Because of a mistake in the git config, I pushed many commits with different names and emails.
git shortlog -sne
indicates the commit counts below. The red-marked entry is the other contributor, while the yellow-marked entries are my commits with two names and three emails. The last line is the correct combination, so I want to modify the other two to synchronize with the last one.
I have tried several ways which were suggested in other posts to override my previous commits, but all affected the number of commits in strange ways.
As an example, creating a file named .mailmap in the project directory with the following content
NameLine4 <MailLine4> NameLine3 <MailLine3>
and then running the command git filter-repo --force --mailmap .mailmap
should sum the number of commits in the last two line, and show 59 NameLine4 <MailLine4>. However, it shows something completely different, by also modifying the other contributor's commits: