Git is one of the best tools that we use to save up our work throughout time and make it easier to collaborate with others and track the changes that have happened. Its usefulness is especially special when you realize the numerous functionalities that it has. One functionality that you may not be aware of is the ability to rename the author of a project.

All you have to do to change the author is to execute the following command.

git filter-branch -f –env-filter “GIT_AUTHOR_NAME=’yourname’; GIT_AUTHOR_EMAIL=’youremail@example.com’; GIT_COMMITTER_NAME=’yourname’; GIT_COMMITTER_EMAIL=’youremail@example.com’;” HEAD;

 

You need to change the palceholders to what you need them to be.

It is necessary to be aware about the existence of many functionalities that Git has and also about their effects. You may not want to lose your work simply because of a quick lookup of a Stackoverflow answer.

You can then make sure that you have made the right corrections by running the following:

git log

Then, you need to execute the following command if you want to push your changes to the master branch.