How to ban users from a specific country for editing a GitHub Repository?

66 views Asked by At

My Question

My Question is that what I have to do if I want to ban a users of a specific country from editing the repository. I want to add a country based restriction to my Repository.

ReasonAn image showing the issues of ExpressJs repository

If you see in the above image, some people are increasing their GitHub contributions by updating readme.md on various repositories. The above is the ExpressJs repository. If you open one of the issues, you will see what they did. A random and non-reason issue by some people showing that he updated the readme.md They just added their own name in the readme.md Another example: Another example of some random no reason issue

1

There are 1 answers

0
bk2204 On

I don't believe GitHub offers a restriction on users from a particular country or region, and, in general, guessing a person's country is not accurate and easy to bypass (my location is often misdetected as in a city over 4000 km away in a different country). Enterprise plans allow restricting valid IP addresses, but that doesn't seem to apply here.

However, there are moderation tools in the settings which allow you restrict which sets of users can interact with the repository. You can also block users and report content to GitHub from the three-dot menu on the PR comment if it's not a positive contribution. Those may be a suitable solution for this kind of problem, and allow you to make changes on a self-serve basis.