Skip to content
GitHubVisionJuly 15, 2021

Guest Branches

On GitHub, contributing to a project you don't own means copying the whole repository first. This vision replaces those contribution-only copies, called forks, with guest branches, so first contributions, repeat contributions and maintainer reviews all get simpler.

0:00 / 25:01

Forks versus branches

Summary

GitHub is where developers host and review code. To suggest a change to a project you can't write to, you first make a fork: your own copy of the whole repository. Forks are excellent when a project is actually diverging. For a one-line contribution, they introduce a second repository, extra remotes, upstream and downstream terminology, ongoing sync work, and a pile of concepts unrelated to the change.

  • Use branches for contribution. A guest branch lives against the upstream repository whether or not its author has write access. Forks go back to representing projects that genuinely intend to diverge.
  • Make the first contribution feel normal. Clone the repository, create a namespaced guest branch, push, and open a pull request. The only new idea is that other people fetch the branch explicitly.
  • Keep repeat contributions simple forever. Contributors branch from the current upstream code instead of maintaining a stale fork or deleting and recreating one every time.
  • Make maintainer review cheaper, too. Maintainers fetch and check out the guest branch from the repository they already have, with no one-off remote pointed at a contributor’s fork.
  • Keep the repository quiet. Guest branches stay out of the default branch list, clone, and branch count. A “your branches” view and explicit search make them available when they matter.
  • Build trust progressively. Maintainers can authorize automated checks (CI) for a first contribution, then promote repeat contributors so future checks run automatically. The same underlying model could support hidden branches for sensitive security work.
  • Treat contributors like friendly visitors. The framing is part of the design: make outside contributions feel welcome without pretending external code has the same trust level as maintainer work.