In git, I would like to amend my name and email address for the entire history of a repository.
Is there a command to do this and if there is, are there any risks associated with doing this?
In git, I would like to amend my name and email address for the entire history of a repository.
Is there a command to do this and if there is, are there any risks associated with doing this?
Here is a snippet code for you to use. (should be single line, breaked for formatting)
You can change any value - name/email etc.
git filter-branch --commit-filter
'if [ "$GIT_AUTHOR_NAME" = "old_name" ];
then
export GIT_AUTHOR_NAME="new_name";
export GIT_AUTHOR_EMAIL="new_email";
fi;
git commit-tree "$@"
'
There are more options if you want to use them but this is.
Read the full documentation here and in particular about git filter-branch
as well.