I was writing a simple script in the school computer, and committing the changes to Git (in a repo that was in my pendrive, cloned from my computer at home). After several c
I found the presented versions way to aggressive, especially if you commit patches from other developers, this will essentially steal their code.
The version below does work on all branches and changes the author and comitter separately to prevent that.
Kudos to leif81 for the all option.
#!/bin/bash
git filter-branch --env-filter '
if [ "$GIT_AUTHOR_NAME" = "" ];
then
GIT_AUTHOR_NAME="";
GIT_AUTHOR_EMAIL="";
fi
if [ "$GIT_COMMITTER_NAME" = "" ];
then
GIT_COMMITTER_NAME="";
GIT_COMMITTER_EMAIL="";
fi
' -- --all