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:
The below method works in my case at least.
In the GitHub web interface, change a branch name (From main to main1 for example). You can do that from the url https://github.com/[user]/[repo]/branches. It will update the contributor list on the repository dashboard.
Then change the name back (main1 to main).
I have multiple GitHub accounts for different projects and different communities and I accidentally pushed a commit using a wrong account. I changed the author of the commit, but the wrong account was still on the contributors list in the repository dashboard.
My method keeps the commit history as well as the 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.
Change repo visibility in GitHub repository settings from public to private and then private to public again.
Note:-
In order to make this work you must not have anything related to that user linked with the repo like commits, releases, commits in other branches, or tags.
Caution:-
You will lose all of your repo stars and watchings. First, use other less risky methods if you care about stars.
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.
It is possible but might be challenging.
You need to rewrite history (which is not recommended usually).
How to do it?
exec git commit --amend --author="{NewAuthorName} <{NewAuthorEmail}>" -C HEAD
Watch this explanation https://www.youtube.com/watch?v=7RZgtT4cbw0.After both updates, wait a couple of minutes and it should remove the contributor from the list.
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.
repo2 is simply the local name of remote repository from which you will be pulling in the commits.None of the answers here worked for me. What I did and worked:
git-filter-repo tool, like this.Perhaps the second point is not necessary.
All the answers before is telling you to rewrite the commit history, and change the branch name back and forth.
However, there is a much easy solution for this, You WON'T need to rewrite anything in your repo.
Just go to Account Settings of your GitHub account, and block the account you want.
You can unblock the account later.
At the moment you will still see the contributor showing on the list, but the number of contributors will be reduced by one.
After a few hours or a day, you will see that the contributor is no longer showing in the list.
Side-effect: The account you block will be disappeared from all the repo owned by you.
I came to this question because I thoughtlessly worked on a copy of my repo that a colleague had downloaded, instead of my local copy.
I hadn't changed the GIT email for the copy of my repo he’d downloaded as I'd (dumbly) copied the repo from his download, so my pushes to GitHub were all attributed to his account, from his email address set (unwittingly) by him (in the ‘.git’ folder) when he logged into GitHub and downloaded my repo.
Once I’d checked and changed the email for that repo to mine (see the two commands below, executed while in the repo’s directory), my pushes were correctly attributed:
git config user.email
git config user.email [email protected]
Unfortunately, he can’t be removed as a contributor to some of these commits without a lot of fiddling, but he’s a trusted colleague and friend so I can live with that.
(Please create appropriate backups before doing any of this)
Assuming that there are not many commits after the commit made by contributor you want to remove.
TL;DR : Revert Changes to stage where there are no contributions by user to be removed ---> Create a new branch and make it default, this is to force github.com to refresh contributor list ---> Change the setting back to old branch as default. You can delete the temporary new branch you created.
3 steps
Remove all branches that that user might have contributed to
Do any number of things to remove all commits related to that author from your remaining branches. Some of your choices:
Turn you repo private, then turn it public again
I accidentally commit README.md with my other acc. I tried creating new repositorie about 8 in total. but my contributor badge from my other account kept popping up. No matter what I deleted (files, commits, etc.), the badge still existed! Even though it's no longer in the commit history, the contributor badge remained.
imagine contributing for NOTHING? pretty no sense.
It took about 3 hours for me to actually get rid of this problem.
And here’s how I dealt with it :
WARNING WARNING WARNING : BACKUP YOUR ENTIRE PROJECT FOLDER FIRST!!
rename main repo to main1
run command :
git branch -m main main1 git fetch origin git branch -u origin/main main1 git remote set-head origin -a
run command :
git rebase -i --root
Delete the commits related to the contributor by changing pick to drop :
before :
pick ce0a125 commit1 pick 0011df3 commit2 pick 193fe65 commit3
pick 7a0c339 commit4
after :
pick ce0a125 commit1 drop 0011df3 commit2 pick 193fe65 commit3
pick 7a0c339 commit4
git push --force
Check the Git website to confirm that the contributor badge you wanted to remove is gone.
Rename the branch back from main1 to main.
run command :
git branch -m main1 main git fetch origin git branch -u origin/main main git remote set-head origin -a
DONE!!
.gitfolder in your local repository. Then initialize a new repository locallygit init, then create a new Github repository and push your new local repository up to it. This obviously removes all history!