How to restrict GitHub repo visibility to one team in a private org

In most private GitHub orgs, “only this team should see the repo” really means “only this team should have repository access, and nobody should inherit broader access by accident.”

This guide explains how to think about that problem with native GitHub primitives first: base organization permissions, nested teams, secret team limits, direct grants, and the difference between a model that exists on paper and one that stays governable over time.

TL;DR

  • Problem: sensitive repositories stay visible too broadly because base permissions, inherited team access, and direct grants drift away from the intended ownership model.
  • Who this is for: GitHub org admins, platform teams, and engineering managers responsible for private code and access hygiene.
  • What this helps you fix: how to keep base access minimal, when to use nested teams, where secret teams fit, and how to stop “just add one more person” from becoming the real model.

1. What usually breaks in real orgs

The important point is that repo “visibility” inside a private org is really an access-model question. If the access model is loose, repo visibility will be loose as well.

2. What GitHub gives you natively

GitHub already gives you the core primitives you need:

That means the problem is usually not “can GitHub do this?” It is “can we operate this model cleanly once the org has real scale, inheritance, exceptions, and sensitive repos?”

3. Recommended model for sensitive private orgs

For private companies with sensitive IP, the practical starting point is:

  1. Keep base organization repository permissions minimal, and set them to none where that fits your org model.
  2. Grant repository access through teams rather than individual users wherever possible.
  3. Use nested teams for hierarchy when you need broad parent ownership with narrower child ownership boundaries.
  4. Treat direct user grants as exceptions that need an owner, a reason, and a review path.

This is usually the cleanest way to keep private repositories visible only to the people who should actually see them, while still making onboarding, offboarding, and ownership reviews manageable.

4. Where teams, nested teams, and secret teams fit

Teams are not interchangeable. Use them deliberately.

A common failure mode is assuming a secret team alone makes the repo appropriately restricted. It does not if the repository still has base-org access, parent-team access, or direct grants elsewhere.

5. A practical decision rule

6. Where GitHub UI becomes painful

GitHub can represent the model. The operational pain starts when you need to verify it across many repositories and teams.

That is where the problem shifts from “permissions exist” to “permissions are not operable at scale.”

7. Where repod helps

repod does not replace GitHub’s permission model. It helps you operate that model more safely.

If you want the repod workflow for this use case directly, continue with how to manage GitHub repo visibility with nested teams using repod.

Related guides

Sources