Git logs preserve author and committer information by design. During a rebase, those values carry forward unless explicitly changed. If you need to mask, rewrite, or anonymize email addresses in Git history, rebase is one of the fastest tools to do it—when you know the right flags and filters.
Start by running an interactive rebase on the commits you want to alter:
git rebase -i HEAD~N
Replace N with the number of commits to process. Mark each commit as edit.
Then, for each stop in the rebase, use:
git commit --amend --author="Name <masked@example.com>"
git rebase --continue
This rewrites the author metadata. To mask committer emails as well, set the GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL environment variables before amending.
For large histories, use git filter-repo (or git filter-branch if you must) to batch-rewrite all author and committer emails: