How to remove contributor from showing in the main page of project:
Link https://help.github.com/articles/removing-a-collaborator-from-a-personal-repository/ says it possible in settings, but I dont see any collaborator in there:
How to remove contributor from showing in the main page of project:
Link https://help.github.com/articles/removing-a-collaborator-from-a-personal-repository/ says it possible in settings, but I dont see any collaborator in there:
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.
The below method works in my case at least.
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.
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.
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="new.name@mail.com"; \
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.
Assuming, it is being done with all the right intentions and, you are the owner of repository - you can use rename feature on repository. Essentially, create replica of repository and swap repository names like you swap variables with steps below.
Create a new replica repository
Copy the cherry picks from original repository which have only the commits with intended authors.
Rename the original repository to to_be_deleted and replica to original.
Commits from original repository can be picked with following steps.
git remote add repo2 https://github.com/mygit/original.gitgit pull repo2git cherry-pick <commit>git push Contributors are essentially the authors of any commit in the repository. I once accidentally put a wrong email in Author list of a commit in my repository and github started showing a new contributor in the repository. I tried reverting the commit but it didn't help. Finally I had to create / rename /delete original repository.