How to Change a Wrong Email Address in a Git Repository
Fleetingusing git-filter-repo
get a fresh clone with ALL the branches
git clone –mirror https://github.com/…
in a mailmap file, set
newname <newaddress> oldname <oldaddress>
git-filter-repo --mailmap mailmap
Or use the callbbacks
git filter-repo –name-callback ‘return name.replace(b"oldname", b"newname")’ –email-callback ‘return name.replace(b"oldaddress", b"newaddress")’
git push –force –all origin git push –force –tags origin
If not in a mirror clone
Note that it will remove the upstream, to ensure you won’t mess up.
git remote add origin https://github.com/… git fetch git co origin/main -B main git branch –set-upstream-to=origin/main