I've changed my email address.
In GitHub, I now have "oldemail@gmail.com" and "newemail@gmail.com". So, with whatever email I use to commit and push on GitHub, these commits are recognised as mine.
Note that for the following explanations, I'm using a repository created for the test. I didn't want to destroy my important repositories.
But I would like to change all my commits to using my new email, to be able to remove my old email from Github and be no longer associated with.
I've seen this question : How do I change the author and committer name/email for multiple commits?
The highest scored answer propose that :
git rebase -r <some commit before all of your bad commits> \
--exec 'git commit --amend --no-edit --reset-author'
I've done that for a repository, to change all the commits from the first one :
git rebase -r --root \
--exec 'git commit --amend --no-edit --reset-author'
It works, but when I push it onto Github, my commit is published with timestamp = now. But actually, my commit has been done earlier. Its timestamp has been changed.
I found something about git and timestamps : git rebase without changing commit timestamps
So I tried again for a fresh test repository :
git rebase -r --root --committer-date-is-author-date \
--exec 'git commit --amend --no-edit --reset-author'
But it changed nothing in apparence, I got the same problem : the timestamp = now even if the commit was done earlier.
-> How to change both the commit author's email, and keep the original commit timestamps ?