DEV Community

Discussion on: How to change the author of all your commits

Collapse
 
waxrat profile image
m¡chael cook 🐌 • Edited

Here's an example of how to fix the email address of commits.
Don't rewrite all commit authors, only the commits with the incorrect email address.

git filter-branch --env-filter '
   if [ "$GIT_AUTHOR_EMAIL" = root@localhost ]; then
     GIT_AUTHOR_EMAIL=michael@example.com
   fi
 ' HEAD
Enter fullscreen mode Exit fullscreen mode