5

On main page of repo we have 2 contributors.

enter image description here

I delete all commits (one :)) of bottom user. On page /graphs/contributors we can see 2 contributors. How remove one from main page of git repo?

Martin Brisiak
  • 3,872
  • 12
  • 37
  • 51
  • 2
    Duplicate of [Removing contributor from github.com?](https://stackoverflow.com/questions/44563131/removing-contributor-from-github-com) – Guy Incognito Oct 22 '20 at 15:51
  • I can't recreate repo. I also delete all commits. This person is only on main page but not in graphs/contributors (if i press on contributors button). – Anton Emelyanov Oct 22 '20 at 16:09
  • This is not a duplicate[Edit: Actually, it might be a duplicate and all the answers on the other are wrong/incomplete.] - I have the same problem. GitHub seems to cache the list of contributors on the main page and does not remove users from that list even if their commits have been fully purged, as the linked question suggests. However, as this is an obvious problem for privacy reasons when a commit is erroneously made with the wrong account, it seems more like a bug with GitHub than a question for StackOverflow (regardless, this is where I ended up while attempting to find a resolution) – Michael May 17 '21 at 06:26
  • I indeed mixed my private and company accounts for a commit and even after removing it from the history, the erroneous account is still listed as contributor. – Booster2ooo Jul 25 '21 at 20:18
  • Can I ask how did you deleted the commits (approved pull request) from the one that you like to remove? – Smilefounder Jun 04 '23 at 10:33

2 Answers2

0

Go to repository settings and follow this path, Settings -> Branches and rename default branch to something else like main1. Then follow the same steps and rename the branch back to main.

asinduvg
  • 67
  • 9
0

It seems like GitHub indeed cache the contributors list, at least for a couple of hours.

I had the same problem and did the following:

  1. Changed all commits emails (two) that pointed to the other account using git-filter-repo tool, like this.

  2. Follow the suggestion of renaming the branches, main -> main1 -> main (didn't work, at least not instantaneously).

  3. Returned to the repo about two or three hours later and it was correct.

In retrospect, perhaps the first point alone would do the trick.

marcelocra
  • 2,094
  • 2
  • 24
  • 37