0

I had few repositories on github with about 400 commits in total, but I decided to change e-mail of my github account and I deleted e-mail which was associated to those commits.

I was trying to use git rebase and git commit --amend but it didn't work - I couldn't specify all commits from repo. Maybe I was doing something wrong tho.

Is there a way to associate all of repo's commits to my new e-mail?

Wiktor
  • 726
  • 5
  • 20
  • Have you tried `git-filter-branch`? Take a look at this [answer](https://stackoverflow.com/a/750182/2102916). The problem with this is that it will completely rewrite your history. – Ricardo Erikson Dec 13 '20 at 19:32

1 Answers1

0

Is there a way to associate all of repo's commits to my new e-mail?

Yes. Create and commit the .mailmap file at the root of the repository containing the email mapping from old to new email address following this documentation:

https://git-scm.com/docs/git-check-mailmap#_mapping_authors

That won't update all the commits like you previously tried to do but is a difficult task because git data structures are immutables but git will take care to no more display your old address and replace it by the newest.

Philippe
  • 28,207
  • 6
  • 54
  • 78