Move from GitHub / Sync
What syncs each way
You want to know which changes on GitHub come here, and which changes here go to GitHub. These tables show each kind of change, in each direction.
6 min read
Issues and pull requests
| What | GitHub to here | Here to GitHub |
|---|---|---|
| Items opened on GitHub | Yes, with their GitHub numbers | Already there |
| Pull requests opened here, into a release branch | Already here | Yes. See Open a pull request that goes to GitHub. |
| Public issues that people open here | Already here | Yes, with the person's GitHub token. See Open an issue that goes to GitHub. |
| Private issues, issues from agents, and other pull requests opened here | Already here | No. They stay here. |
| Comments, reviews, line comments and replies | Yes | Yes, from people |
| Title and body edits, close and reopen, draft or ready for review, labels, assignees, resolved threads | Yes | Yes, from people |
| Reactions | Yes, the next time something else on the item changes. See Reactions. | Yes, from people |
| Notes on assignees | No. GitHub has none. | No. They stay here. |
| Comment edits | Yes | Yes, from people. See Edit the title, the description and comments. |
| Deleted comments | Yes | Yes, from people. Without a GitHub connection, the comment is deleted here only. See Hide or delete a comment. |
| Hidden comments | No | No. A hide stays here. |
| Checks of pull requests on GitHub | Yes. See Checks from GitHub. | No |
For what agents can do on these items, see Who can act on items from GitHub.
New open items from GitHub are screened before they show. Screening starts as soon as the sync brings the item here. Until it ends, the item has a blue Screening badge, and only its author and the maintainers see it. See See what runs on an item.
Code
| What | GitHub to here | Here to GitHub |
|---|---|---|
| Release branches | Yes, fast-forward only | Yes, fast-forward only |
| The merge of a private pull request into a release branch | Comes down after GitHub took it | Yes, with the token of the person who merges, before the branch moves here. See A private pull request. |
The code of GitHub pull requests (refs/pull/<n>/head) | Yes | No |
| The head branch of a pull request opened here and on GitHub | Yes, when the commit on GitHub builds on the head here | Yes, each push here. Here wins. |
| Tags | Yes | No |
| Other branches | No | No |
Other branches do not follow GitHub. A branch that the import brought stays at its commit of that time, and a branch that GitHub got later is not here. So the branches here can differ from GitHub's. To get the code of a pull request from GitHub, use its pull ref, which sync keeps the same as GitHub's:
src pr checkout 7
git fetch origin refs/pull/7/head
src pr checkout 7 fetches that pull ref into a local branch with the name of the head branch on GitHub.
The head of a pull request from GitHub is that pull ref here, not a branch. src pr view 7 --json headRefName still gives the branch name that GitHub has, as gh does, and headRepositoryOwner and isCrossRepository say if it is from a fork. REST and MCP give the pull ref as head, and the head on GitHub as githubHeadLabel: branch, or owner:branch for a fork. When GitHub no longer has the fork, it is only the branch. It is null for a closed pull request that sync has not read since the forge started to keep the name. Then headRefName gives the pull ref. src pr list shows the same head in its BRANCH column.
The git servers of the forge download the code from GitHub with git fetch. A repository with many open pull requests gets their code in groups:
- The first download brings the release branches, the tags and at most 50 pull request heads. Each later download brings at most 50 pull request heads.
- A download asks only for the refs whose commit on GitHub is not the commit here.
- A download has no limit of objects or of size. The forge waits for it for up to 10 minutes.
- A pass starts no new download 2 minutes after the first one began. The next pass gets the rest.
- A repository at its size limit gets no code from GitHub. See When a repository nears its size limit.
In each download, git tells GitHub which commits the repository has. So GitHub sends only the objects that the repository does not have, not a full copy of the history. A new pull request into a long-running branch brings only its own commits, once the history of that branch is here. git moves a ref only when the repository has every object that its commit needs.
Stacked pull requests from GitHub
On GitHub, a pull request can go into the head branch of another pull request, not into main. Other branches do not come here, so the forge uses the code of the pull request below in place of that branch:
- The pull request shows only its own commits and changes, on top of the pull request below.
- The two show as a stack here, with the upper one on the lower one.
- When the pull request below is not open here, the upper one compares with the base commit that GitHub has for it.
- The base and the head of these pull requests stay on GitHub. You cannot change the base here, and a stack sync never merges into their heads. When the lower one merges on GitHub, GitHub moves the upper one onto the next base, and sync brings that here.
Item numbers
- An issue or a pull request that opens on GitHub when you create it gets the GitHub number here too. See Open an issue that goes to GitHub and Open a pull request that goes to GitHub.
- Every other new item here gets the next free number, for example an agent's issue.
- An item that opens on GitHub later keeps its number here. Its page shows the GitHub number, for example "(GitHub #7)".
- If the number of a GitHub item is in use here, the item gets the next free number. Its page shows "(GitHub #7)", and the sync settings count these items.
- Items that have numbers from 100001 up keep them.
Not synced
- GitHub discussions, and the Community posts here.
- Milestones.