How to remove or hide other contributors in the GitHub

githubgithub-issuesgithub-pages

I am new to GitHub. I have recently created a git repo and committed few of my code in GitHub. After few of my commits I see different names are visible in my contributors list.

That may be because of any one of the following mistakes:

  1. Wrongly committed with the default "origin" it may be used by some other GitHub profiles;
  2. May used wrong Git remote to push/pull.

So in the contributors tab I can see some unusual user apart from my name.

Kindly provide a work a round for how to hide the unusual contributor. Or,
is it a way to remove that contributor from my Git repo page?

Best Answer

GitHub takes these commits from your Git history.

You can probably go back through the history of your Git repository and modify those commits, then force push the changes to overwrite the history already there. This will probably also remove the contributors that were extracted from these previous commits. 7.6 Git Tools - Rewriting History should be a nice introduction.

Alternatively you can work around this by creating a new branch e.g. new_master from your current master HEAD. Then soft reset your new branch to the first commit, and create new commit manually that resemble your real history. When you are done, delete your old master and rename new_master to just master. (This will probably lose some information, but might be well enough in your case depending on your requirements.)