Changing the Author to Your Github Repository

Jeffrey Martinez
2 min readJan 4, 2021

One question can be: why are my commits not reflecting in the GitHub contributions graph?

Another question can be: why does the author in my GitHub repo say GitHub username?

And… one more question can result to maybe asking: how can I change the author and make the commits reflect my contributions graph within my GitHub Overview page?

Well, these are very good questions, don’t you think?

This article will explain why and how this can be changed and show your contributions to your graph

When creating your repository, first step is to check in your repository commits who the author is, if you see that ‘GitHub username’ is the user, then, you may have configured the author in your terminal yet.

You can also check within your projects root, by typing

git log

This will display all the commits and the author.

Second Step is to copy and paste this code to your terminal.

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;

Make sure you replace anything with single quotes with the values you want it to be. For example instead of this:

GIT_AUTHOR_NAME=’yourname’;

You should put your actual name like this:

GIT_AUTHOR_NAME=‘John Smith’;

Now, it’s important to check to see if all your commits have changed from ‘github username’ to ‘John Smith’ by typing git log and checking your commits and the author you have established.

Second to last, we are going to push these commits to your origin master/main. Make sure within your repository, you check the name of the branch if it is either main or master. You will then perform to copy and paste this code to the terminal:

git push --force origin master

Lastly, Check in your repo commits that the author has changed and that it says the correct author name. Also, by implementing these steps, this should allow all these commits to display within your contributions graph in your overview. For all the days you have been committing, because of these steps taken, will show on your graph.

--

--

Jeffrey Martinez

I am a graduate from Flatiron School for Software Engineer. Studied HTML, CSS, Ruby, Ruby on Rails, JavaScript, React, Redux, Sinatra, and Sqlite3