I have been working on a git repository for a while and made some commits. I have been using documentation blocks in my php files, including my private email address, like this:
/**
* Bla bla bla.
*
* @author: Nic <foo@bar.com>
*/
Now I have created a new email address and updated the documentation blocks, replacing the old address with the new one. But this change only applies to commits after the one where I changed the documentation.
How can I completely remove the old email address from git's history and replace all instances with the new address?
I have tried using git filter-branch using this blog post but without success. I get the following result:
git filter-branch --tree-filter 'git ls-files -z "*.php" |xargs -0 perl -p -i -e "s#old-email@example.com#new-email@foobar.com#g"' -- --all
Usage: git core\git-filter-branch [--env-filter <command>] [--tree-filter <command>]
[--index-filter <command>] [--parent-filter <command>]
[--msg-filter <command>] [--commit-filter <command>]
[--tag-name-filter <command>] [--subdirectory-filter <directory>]
[--original <namespace>] [-d <directory>] [-f | --force]
[<rev-list options>...]
Could it be that the special characters of the email addresses (@ and .) are messing up the regular expression? Other than that I have no idea what's going wrong, any help is appreciated!