Sakthi Karthik Sakthi Karthik -3 years ago 216
Git Question

how to rename author name in GIT version control after pushed many changes?

I am using

version control.

I've committed and pushed some changes with my first name as author name. then many authors committed and pushed our changes, but now I need to change the committed author name only not message.

Is any way to do this changes?

Answer Source

It seems you want to change the author name for all the commit histories. You can use git filter-branch to change the author name:

git filter-branch --commit-filter '
        if [ "$GIT_AUTHOR_NAME" = "old name" ];
                GIT_AUTHOR_NAME="new name";
                git commit-tree "$@";
                git commit-tree "$@";
        fi' HEAD

It will take a few minutes to rewrite the commit history.

After that you can use git push -f --all to update the remote repo.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download