How Do I Change the Author and Committer Name/Email for Multiple Commits?

Better Stack Team
Updated on June 24, 2024

To change the author and committer name/email for multiple commits, you can use the git filter-branch command with the --env-filter option. This allows you to rewrite commit history by modifying environment variables.

First, create a script that updates the author and committer information. Open your text editor and create a script, for example,, with the following content:


git filter-branch --env-filter '

CORRECT_NAME="New Author Name"

' --tag-name-filter cat -- --branches --tags

Replace with the old email address, New Author Name with the new author name, and with the new email address.

Make the script executable using the following command:

chmod +x

Execute the script to rewrite the commit history:


After rewriting the commit history, force-push the changes to the remote repository:

git push --force --tags origin 'refs/heads/*'


  • Rewriting commit history can cause issues if the commits have already been pushed to a shared repository and other collaborators have based their work on them. Use it with caution.
  • After rewriting commit history, collaborators who have pulled the changes will need to rebase their work to incorporate the updated history.
  • Consider communicating any changes to other collaborators to avoid confusion.
Got an article suggestion? Let us know
Explore more
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Make your mark

Join the writer's program

Are you a developer and love writing and sharing your knowledge with the world? Join our guest writing program and get paid for writing amazing technical guides. We'll get them to the right readers that will appreciate them.

Write for us
Writer of the month
Marin Bezhanov
Marin is a software engineer and architect with a broad range of experience working...
Build on top of Better Stack

Write a script, app or project on top of Better Stack and share it with the world. Make a public repository and share it with us at our email.

or submit a pull request and help us build better products for everyone.

See the full list of amazing projects on github