git – Could I change my name and surname in all previous commits?

Question:

I would like to change my name, surname and email in my all commits, is it possible?

Answer:

Use git-filter-branch.

This only affects the author, not the committer (which for most commits will be the same as the author). If you want to rewrite those as well, set the GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL variables.

The standard warning about rewriting history applies; only do it to history that has not yet been shared.

June 2018 Update

The manual now includes a solution, using --env-filter, in its examples: https://git-scm.com/docs/git-filter-branch#_examples :

Leave a Reply