Skip to content

How to share a private GitHub repository

If someone only needs to review code, they may not need GitHub access at all. Compare collaborator access, fine-grained personal access tokens, and a scoped read-only review link—then choose based on whether the recipient needs to browse, automate, or contribute.

  • Repository stays private on GitHub
  • No viewer account for a RepoView link

What you are trying to accomplish

Most people looking for a way to share a private GitHub repository want one person to inspect a specific piece of work without making the repository public or setting up a lasting collaboration. The practical question is what the recipient needs to do: browse selected files, make authenticated GitHub requests, or contribute changes.

A collaborator invitation is for repository access. A personal access token is for authenticating a person or integration to GitHub. A RepoView link is for browser-based review of the repository and ref you authorize. These approaches are not interchangeable.

Three ways to share private GitHub code

GitHub collaborators: for ongoing repository work

Invite a person through GitHub when they need repository-level access—for example, to clone or fetch the code, use GitHub's collaboration tools, or contribute through the workflow your repository allows. The invitation and permission level are managed in GitHub, and the person accepts the invitation there. Organization rules may also control who can be invited and what access they receive. See GitHub's guide to inviting collaborators to a personal repository.

This can be inappropriate for a recruiter, prospective client, or one-time reviewer who only needs to inspect a project. It creates a GitHub access relationship and an invitation to manage, even when the actual task is just to read a selected snapshot of work. If the repository belongs to an employer or client, the owner may also be subject to access policies or confidentiality terms that do not permit adding an outside reviewer.

Fine-grained personal access tokens: for API or Git operations

A fine-grained personal access token (PAT) authenticates its creator to GitHub. GitHub lets the creator limit a token to a resource owner, selected repositories, specific permissions, and an expiry where available. A token cannot grant access beyond what its creator can already access. GitHub describes PATs as credentials and recommends treating them like passwords; see its guides to managing personal access tokens and fine-grained token permissions.

A PAT can be relevant when an authorized account needs a script or integration to call GitHub, but it is not a good way to send repository access to a recruiter. Do not put your own token in an email, document, or share link. If another person needs direct GitHub access, grant that person access through GitHub and let them use their own approved credentials.

RepoView is designed for the narrower case where a reviewer needs to browse code, not join the GitHub repository. The owner connects a GitHub App installation with read-only Contents access, chooses a registered repository and ref, and creates a share. The repository remains private on GitHub; RepoView serves the content allowed by the repository and share visibility rules. The recipient opens the link in a browser without a RepoView or GitHub account.

This is a fit for a read-only review, not for cloning, pushing changes, or opening a pull request as a contributor. If the recipient needs those GitHub workflows, invite them through GitHub under the permissions and policies that apply to the repository.

How RepoView sharing works

The owner controls the source and scope. The recipient receives a link to browse only the content authorized for that share.

  1. Connect GitHub and select a repository. Create a RepoView workspace, connect a GitHub App installation, and enable a repository the installation can access.
  2. Choose the ref. Select the branch or ref that the recipient should review.
  3. Set the visible paths and expiry. Keep the repository's default visibility rules or narrow the share with hidden or allow-only path patterns. Choose an expiry if you want access to end automatically. Downloads are disabled unless the owner enables them.
  4. Create and send the scoped share. RepoView creates a link for that repository and ref. A recipient label can help you organize shares, but it does not verify who opens one.
  5. The recipient opens the link and browses. They can navigate the authorized file tree and view supported source, rendered Markdown, repository images, and diagrams in a read-only browser experience.
  6. Review activity and end access. From the owner dashboard, inspect the signals available for the share, set or change its expiry where available, or revoke it.

RepoView retrieves private repository content server-side through the owner's GitHub App connection. The viewer gets a share session, not the owner's GitHub credentials or an invitation to the repository.

Choose the method for the recipient

Use a review link when reading is enough. Use GitHub access when the person needs to work with the repository itself.

When in doubt, share the smallest authorized slice that lets the recipient do the job, set an expiry if the review is temporary, and use an authenticated GitHub workflow when a bearer link is not an appropriate control.

Need a browser-based review link?

Create a workspace, connect GitHub, and choose the repository and ref to share.

RepoView home · Privacy · Terms