Git
Pull requests
Propose, review and merge changes between branches.
Open a pull request
Push a branch, then in the Git portal open the repository's Pull requests → New pull request. You need git:write.
- Merge into and From: the target and source branches. They must differ, and only one pull request can be open for the same pair.
- Title: up to 150 characters.
- Description: Markdown, up to 10 KB.
Pull requests are numbered with issues, in one sequence per repository.
Review
A pull request has three tabs:
- Conversation: the description and comments. Anyone with
git:readcan comment. - Commits: what the source branch adds to the target, up to 50 commits.
- Files changed: unified or split diffs. Open pull requests compare the merge base with the source branch's latest commit, so new pushes show up on reload. Renamed files show their old and new path, with the share of content kept when it changed; a deleted and an added file count as a rename when they're the same, or at least half the same and share a name or folder.
Approvals
Members with git:write other than the author can approve. On a protected branch, a pull request merges only with the required approvals; the rule is added when the pull request is opened and follows changes to the protection.
Merge
Merge (needs git:write) offers the strategies that apply to the branches right now:
| Strategy | Result |
|---|---|
| Squash and merge | One new commit on the target with all the changes. |
| Fast-forward | The target moves to the source's latest commit. Only possible when the target hasn't moved since the source branched. |
| Three-way merge | A merge commit joining both histories. |
Squash and three-way merges take a commit message (default: the title and number, like Add search (#12)) and record you as the author. If the source branch changed after you loaded the page, the merge fails instead of merging commits you haven't seen.
When no strategy can merge automatically because of conflicts, resolve them locally, push the source branch, and reload.
Close
Close is open to the pull request's author and to members with git:write, and so is Reopen, as long as both branches still exist.
Pull requests merged or closed outside the portal, for example by pushing a merge yourself, are marked merged or closed the next time the list or the pull request is opened.