What repository visibility and access control options does git.sr.ht offer?

Updated

git.sr.ht offers three repository visibility levels — public, private, and "unlisted" — plus fine-grained access control that can extend to people who don't have a sourcehut account. That combination is the main reason to pick it over a plain Git host: you can keep a repo out of public listings without making it fully secret, and you can hand a specific collaborator read or write access without requiring them to register.

Repository visibility options

The service documents three states for a repository:

Visibility Who can see it Typical use
Public Anyone, including anonymous visitors Open-source projects you want discoverable
Private Only you and users you explicitly grant access Client work, credentials-adjacent code, unfinished projects
Unlisted Anyone with the URL, but it isn't listed or indexed Shareable links, staging repos, work you don't want crawled

The distinction that matters most is between private and unlisted. Private means access is enforced — an anonymous visitor with the URL gets nothing. Unlisted means the repository is reachable by direct link but deliberately kept out of public listings, so it behaves like an "unadvertised" repo rather than a locked one. If your goal is secrecy, choose private; if your goal is "don't publicize this yet," unlisted is the lighter option.

Fine-grained access control

Beyond the three visibility levels, git.sr.ht provides fine-grained access control. In practice this means permissions are assigned per user and per repository rather than through a single all-or-nothing switch, so you can decide who may read a private repo and who may push to it.

The notable capability is that access can be granted to users without accounts. You are not forced to have every collaborator register on sourcehut before they can reach a private repository. This is useful when you're working with someone who just needs to clone or push to one repo and has no interest in maintaining a forge account.

How to choose

  • Open-source project meant to be found → public.
  • Code that must not leak, shared with a known set of people → private, with explicit grants.
  • Code you're willing to share by link but don't want listed → unlisted.
  • One-off collaborator without a sourcehut account → private or unlisted repo plus a direct access grant.

What this page does not cover

The source material describes the visibility and access-control features but does not state pricing, storage limits, or the exact interface for issuing a grant. Those details aren't established here, so treat them as things to confirm on the service itself before committing a workflow to it.