Removing contributor from github.com?

You cannot remove it, but you can change their name (to yours). Yet, I would strongly advise not to, because this would affect all other collaborators and contributors (see below).

This is described in detail here. In short, you have to use filter-branch, e.g. through the following script:

git filter-branch --env-filter '
if [ "$GIT_AUTHOR_NAME" = "OLD NAME" ]; then \
    export GIT_AUTHOR_NAME="NEW NAME" GIT_AUTHOR_EMAIL="[email protected]"; \
fi
'

The reason why better not - it comes with some serious side effects, such as invalidating all subsequent commit hashes, as also mentioned by Peter Reid.


The below method works in my case at least.

  1. On GitHub web page, change a branch name (main --> main1 for example). It updates a contributor list on my GitHub repository dashboard.
  2. Then change it back (main1 --> main).

I have multiple GitHub accounts for different projects. Each for different community. But accidentally, I pushed a commit using a wrong account. I changed the author of the commit, but the wrong account was still on the contributor list on GitHub dashboard. My method keeps commit history as well as GitHub action settings and issue history. But I did not check if pull requests are kept.


You cannot (at least without rewriting history - which is highly unrecommended).

Those users have commits in your repository history, and therefore lines of code have been added by them. Even if you remove all their lines of code they will still show as a contributor.

Contributors are not collaborators.

Collaborators are contributors authorized by the repository owner to have direct (usually write) access to the repository, meaning they don't need to fork the repository and they can be assigned to issues among other things.


I accidentally pushed a commit from an old account. The old account remained on the contributors' list even after I had removed the commit. I had to remove the old account from GitHub to make it disappear from the list.

Tags:

Git

Github