Skip to content
Source
Sign inSign up

Open pull requests on GitHub

Move from GitHub / Sync

Open a pull request that goes to GitHub

Your main on GitHub can require a pull request and passing checks. A pull request that you open here into a release branch opens on GitHub too, so GitHub's rules apply to it.

3 min read

You need:

  • GitHub connected for sync. See Connect GitHub.
  • Write access to the repository.

1. Open the pull request here

Open a pull request into a release branch, as on any repository. It opens on GitHub at once when all of these are true:

  • You connected GitHub, and you have write access.
  • Its head is a branch of this repository, not of a fork.
  • It is public, and not held for review.

Then the forge does three things, with your GitHub token:

  1. It pushes the head branch to GitHub, with the same name.
  2. It opens a GitHub pull request with the same title, body, base branch and draft state.
  3. It writes the pull request here with the GitHub number, and links the two. So #7 is the same pull request on both sides.

2. Work on it as a GitHub pull request

From then on, the pull request is an item on GitHub. Comments, reviews, close and reopen go to GitHub, as for a pull request from GitHub. Comments and reviews from before the link stay here, with an Only here mark.

Done

Your pull request is on both sides, with the same number. The checks and reviews that GitHub requires apply to it, and you see its checks here: see Checks from GitHub.

When it stays here, or gets another number

  • If the GitHub number is in use here, for example by a deleted or moved issue, the pull request gets the next free number. Its page shows "(GitHub #7)".
  • If GitHub refuses the pull request, it stays here, with the next free number. Its page offers Open on GitHub.
  • A pull request from a fork, and a private pull request, stay here. A private one still merges into a release branch: its merge goes to GitHub then. See A private pull request.
  • A pull request opened by an agent, or by a person who did not connect GitHub, is only here. It has the next free number.

Open a pull request on GitHub later

A person opens a pull request that is only here on GitHub:

  1. If you did not connect GitHub, do Connect GitHub.
  2. Open the pull request.
  3. Click Open on GitHub.

In a terminal:

src github-sync open 7
  • Add -R OWNER/REPO outside a clone.
  • REST has POST /api/v1/repos/:owner/:repo/pulls/:number/github, and MCP has the open_pull_on_github tool.
  • You need write access. An agent's token is refused.

The pull request keeps its number here. Its page shows the GitHub number, for example "(GitHub #7)".

The head branch stays the same on both sides

  • Each move here of the head branch goes to GitHub. Here wins: the forge force-pushes the branch on GitHub.
  • A move goes to GitHub within seconds: a git push, also from an agent, or Update branch.
  • Your own git push and your Update branch use your GitHub token. A move by an agent or a job uses the token of the person who opened the pull request on GitHub.
  • A commit pushed to the branch on GitHub comes here when it builds on the head here.
  • If someone rewrites the branch on GitHub, it does not come here. The next push here overwrites it.