Skip to content
Source
Sign inSign up

Choose who sees each part

Code and repositories / Repository settings

Choose who sees each part

A public repository shows everything to everyone. Sometimes you want people to read the issues, but not the code or the pull requests, to read the code but not take a copy of it, or to keep the CI logs and the agents' runs to your team. Give each part of the repository its own audience, and keep the rest open.

6 min read

You need to be an admin of the repository.

1. Open Visibility

Open the Settings of the repository. Under People, click Visibility.

The Visibility settings, with an audience for Code, Clone and download, Issues, Pull requests, CI and Agents

2. Pick an audience for each part

Each part has a list. Pick who sees it:

  • Everyone: anyone who can open the repository. On a public repository, this is everyone, also people who are not signed in. This is the default.
  • Members: people given a role on the repository: collaborators, teams, and the members of its organization.
  • Triage and up, Write and up, Maintain and up: people with that role or a higher one.
  • Admins only: the admins of the repository.

The parts are:

  • Code: the files, the README, commits, branches, tags, blame, compare, code search, the architecture, the dependencies and npm tabs, and the diffs of pull requests.
  • Clone and download: git clone and fetch, Git LFS files, ZIP and tar.gz downloads, and forks. It is never wider than Code, because a clone holds all the code.
  • Issues: the issues, with their comments, labels and timelines, and the links to them from pull requests and commits.
  • Pull requests: the pull requests, with their conversations, reviews and merges, and the merge queue.
  • CI: CI runs, jobs, logs, findings and artifacts, the checks of pull requests and commits, CI variables, caches and package previews. It is never wider than Code, because the logs show the code.
  • Agents: the runs of the factory agents, agent workflows and agent tasks, with their logs, verdicts, activity and spend. It is never wider than Code, because the logs of agents show the code.

When you narrow Code, Clone and download, CI and Agents narrow with it.

An audience only narrows. Nobody gets more than their role allows: a person with read access can't push, whatever you pick. An agent and a CI job see a part when the person they work for sees it.

3. Save

Click Save in the bar at the bottom.

What people see

A person outside the audience of Code still opens the repository. The home page shows its description and members, and says that the code is hidden and who sees it. Issues, pull requests, CI and the rest work as their own audiences say.

A pull request shows its conversation, its reviews and its checks (when CI is open to them). Its Commits, Files changed and Impact tabs are hidden, and a comment on a line of the diff shows as a plain comment. The PR chat is off for them, because it reads the diff.

A pull request seen by a visitor who may not see the code: only the Conversation tab, and the line comment as a plain comment

A person outside the audience of Clone and download gets no Clone or Fork button. git refuses their fetch. When they are signed in, git shows the reason, for example Clone and download of this repository is visible only to people with write access or more. When the code is hidden from people who are not signed in, git asks them to sign in.

A person outside the audience of Issues, or of Pull requests, still sees the tab, with no count. It says that the part is hidden and who sees it. They can't open, comment on or create an issue or a pull request of that part, also not one that they wrote before. Their dashboard, search and notifications leave those items out, and a link to one from another part (such as "fixes #12" on a pull request) shows no title. A person can only open a pull request where they see the pull requests, so any audience but Everyone also keeps people with no role on the repository from opening one there.

The Pull requests tab seen by a person without write access: the part is hidden, and it says who sees it

A person outside the audience of CI gets no checks box on a pull request, no package previews, and no CI runs, logs, artifacts or variables. The CI pages say that CI is hidden and who sees it, and REST, MCP and src answer 403 with the reason, for example CI of this repository is visible only to people with write access or more. The merge box still shows what a merge waits for, but says only that the required checks have not all passed, without naming them. Notifications of a failed CI run and the Needs attention items of CI go only to people who see CI.

A person outside the audience of Agents gets no Agents tab content, no agent runs on issues and pull requests, and no agent workflows, agent tasks or their logs. The pages say that the agents are hidden and who sees them. Notifications and Needs attention items of agent runs go only to people who see the agents. The software factory still runs: the audience only decides who reads its work.

The lists across repositories, such as the skills marketplace and the npm downloads of an organization, show what a repository's code offers only while its Code is open to everyone.

Agent transcripts and agent memories that you opened to every reader are read only by people who see the code.

Forks

A fork holds the same code, so it keeps the audiences of Code and of Clone and download of its upstream. A fork made after you narrow one of them starts with the same audience. When you narrow one later, every fork narrows with it. A fork's admin can narrow it more, but never open it wider than its upstream. A fork has issues and pull requests of its own, so its admin sets those audiences.

Forks made before you narrowed a part keep the copy of the code that they have.

From a terminal

The setting works the same from a terminal, for admins:

src repo sections
src repo sections code members
src repo sections clone write
src repo sections pulls write
src repo sections ci write

The REST API has it at GET and PUT /api/v1/repos/<owner>/<repo>/sections, and MCP has the tools get_section_audiences and set_section_audiences.

A change can take up to 5 seconds to reach people who are not signed in.