10 ms·
The standard way to do that is with 'git filter-branch'. If your daughter’s email is megatron@example.com, git filter-branch --env-filter ' old_email=m
by klodolph 7y ago
The standard way to do that is with 'git filter-branch'. If your daughter’s email is megatron@example.com,
git filter-branch --env-filter '
old_email=megatron@example.com
new_email=redacted
if [ "$GIT_COMMITTER_EMAIL" = "$old_email" ] ; then
export GIT_COMMITTER_EMAIL="$new_email"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$old_email" ] ; then
export GIT_AUTHOR_EMAIL="$new_email"
fi
' -- --all
This is “safe” in the sense that you can go back to the old version with the reflog if you screw things up.
- saidajigumi 7y agoSeconded. The git blame-someone-else tool is just using git rebase and git commit --amend internally to alter one specified commit. git filter-branch is perfect for this kind of wholesale revision. filter-branch is essential for tasks like: open-sourcing repos that need some kind of cleanup, massaging repos generated by a VCS migration tool, etc. For example, years ago I participated in the move of a large CVS repo to git; there was significant filter-branch post-processing required to create an acceptable baseline)