Skip to content
Versora

Manual

Merge requests

Create merge request

7 min read

On this page

The Create merge request form (on GitHub, Create pull request) opens the MR on the server without leaving Versora. It arrives already filled in: the most likely target, the title and description taken from the commits (or from the branch's issue), the project template and the reviewers suggested by CODEOWNERS. If the branch isn't on the remote yet, or is ahead of it, the push is done first, with the usual checks.

Where to find it

Entry pointWhen it appears
Local branch menu › Create merge request from feature/login…The branch is already on the remote.
Local branch menu › Push feature/login and create merge requestThe branch hasn't been pushed yet, or has unpushed commits.
Remote branch menu › Create merge request from origin/feature/login…Only for branches of the integration's remote. There's nothing to push.
MERGE REQUESTS section › + button ("Create merge request from feature/login")For the current branch.
"Pushed feature/login." notice › Create merge requestRight after a push. It disappears after 20 seconds.
Branch stack › Create stack merge request for feature/parte-2…Branch in a stack. See Stack merge requests.
WORKFLOW section › FinishWith a workflow preset. See Hygiene and workflow.

The branch menu items don't appear for the project's default branch (for example, main). When the branch already has an open MR, the menu replaces the items with Open merge request !42 in browser.

There's no shortcut or dedicated palette command to create an MR.

Step by step

  1. Right-click the feature/login branch and choose Create merge request from feature/login… (or Push feature/login and create merge request).
  2. Check the top line: "On GitLab, in equipe/app (gitlab.exemplo.com)." That's the project where the MR will be created.
  3. Check the Target. The app has already chosen the most likely one (see the table below).
  4. Adjust the Title and the Description, if you want. Choose another Template, if the project has one.
  5. Check the options (draft, delete source branch, squash) and the suggested reviewers.
  6. Click Create merge request (or Push and create merge request), or press Ctrl+Enter.
  7. On the final screen, choose Open in browser, Copy link or Close.

The form fields

Source and target

  • Source: the branch on the remote, for example origin/feature/login. It can't be edited here.
  • Target: lists the branches of the integration's remote, except the source branch itself. The project's default branch appears with "(project default)". With no other branch, the list shows "(no other branch on origin)".

The target comes already chosen, in this order of preference, among those that exist on the remote:

OrderSuggested target
1The branch below, when the branch is part of a stack
2The target of the repository's workflow preset (Hygiene and workflow)
3The project's default branch, as reported by the server
4main, master or develop
5The first one in the list

With a workflow preset, if you choose another target, you see the warning "In the trunk-based workflow, feature/login goes into main." with the Use main button.

Title and description

The app suggests the text from the commits that go into the MR (the branch's commits that the target doesn't have):

  • One commit: its title and body.
  • Several commits: the title of the newest one and, in the description, the list of all of them, from oldest to newest (- Fix validation, - Add test…). The label becomes "Description — 3 commits".

Changing the target redoes the suggestion, until you edit the field. After that, your text stays.

If the branch has an issue (for example, feature/123-corrige-login), the issue goes into the text:

Issue sourceTitleDescription
GitLab or GitHubthe issue's titlestarts with Closes #123, if it doesn't mention the issue yet
JiraPROJ-12 and the issue's titlestarts with Jira issue: [PROJ-12](address)

The form waits for the issue for up to 4 seconds; if the server takes longer, it goes on with just the commits. See Branch issue.

After that come the project's title template and default template, when they exist. See Templates and default title.

OptionWhat it doesDefault
Draft — not ready for review yetCreates the MR as a draft. Merging is only possible after marking it as ready.unchecked
Delete source branch after mergeGitLab only. The server deletes the branch when the merge is done.the project setting (or the workflow preset)
Squash commits on mergeGitLab only. Combines the commits into one on merge. When the project enforces the option, the checkbox is locked ("Set in the project settings").the project setting
Push feature/login to origin before creatingPushes the branch before creating the MR. When there are unpushed commits, the text says how many ("(2 commits not pushed yet)"). When the branch isn't on the remote yet, the checkbox is checked and locked ("(the branch isn't on the remote yet)").checked when you used "Push … and create"

Viewing the changes before creating

Right below the options, a line summarizes what goes into the MR, for example "12 files changed +340 −25". The View changes button opens the preview "Changes from feature/login into origin/main":

  • at the top, how many files, commits and binaries ("12 files · 3 commits · 1 binary");
  • on the left, Changed files, with each one's state (added, deleted, renamed, copied, modified);
  • on the right, the diff of the chosen file, with the app's usual look;
  • Back to the form (or Esc) goes back without losing anything.

The comparison starts from the common commit between the target and the branch, the way the server shows the MR diff. "Nothing changes compared to the target." means the branch brings no changes.

Suggested reviewers (CODEOWNERS)

When the repository has CODEOWNERS on the target branch, the Suggested reviewers (CODEOWNERS) block lists the owners of the changed files, grouped by section:

  • each person has a checkbox; "you" appears next to your username;
  • groups and roles ("members with the developer role") have Show members to choose people;
  • how many files each owner covers, and how many files have no owner;
  • on GitLab Free, "On GitLab Free a merge request takes a single reviewer.";
  • in the footer, "A review will be requested from 2 reviewers when the merge request is created." or "No reviewer selected.".

The review is requested right after the MR is created ("!42: review requested from @ana, @bruno."). See CODEOWNERS.

Form warnings

WarningWhat it means
"There's already an open merge request !42 for feature/login; GitLab will likely reject another one."Use the MR that already exists.
"There's no other branch on origin to use as the target. Fetch and try again."The remote hasn't been fetched yet, or only has this branch.
"feature/login is 2 commits behind origin/feature/login: the push will be rejected. Pull first."Someone pushed commits to your branch. Pull first.
"The merge request will be created from what's already on origin/feature/login; local commits that weren't pushed are left out."You unchecked the push before creating.
"feature/login has no commits beyond origin/main: there may be nothing to merge."The target already has everything the branch has.
"This merge request is expected to conflict with origin/main in 2 files: …. Update the branch with the target first, or resolve it on the server."The conflict prediction found a conflict. See Conflict prediction.

After creating

The final screen shows "Merge request !42 created", the title, feature/login → main (with "· draft" if that's the case) and the address. The buttons are Close, Copy link and Open in browser. The panel list is refreshed on its own.

What Versora does in git

With the push checked, the app runs the usual push (with upstream, if it was missing), after the push checks:

bash
git push -u origin feature/login

The suggested commits come from the local repository, comparing the target with the branch:

bash
git log origin/main..feature/login

The MR itself is created through the server API (GitLab: POST /projects/:id/merge_requests; GitHub: POST /repos/:owner/:repo/pulls), with the title, description, target and options.

How to undo

Ctrl+Z doesn't delete the merge request: it stays on the server. To give up, close the MR from its page (Open in browser). The push isn't reverted by Ctrl+Z either (see Push).

Caveats and messages

  • "Enter a title.": the title is required; the button is disabled without it.
  • "The target branch must be different from the source branch.": choose another target.
  • "The push of feature/login didn't finish (see the notice). Nothing was created.": the push failed or was rejected by a check. Fix it and push again.
  • "The branch feature/login no longer exists in this repository.": the branch was renamed or deleted while the form was open.
  • "!42 was created, but the review couldn't be requested: …": the MR exists; request the review from the in-app review (Reviewers).
  • "To create merge requests, register an access token for gitlab.exemplo.com with the "api" scope.": without a token, there's no integration. See Git servers.
  • Clicking outside the form only closes it if you haven't touched the title or the description; Esc always closes it.
  • Pre-push checks: Preferences › Checks, Push rules and CI validation. See Checks.
  • Conflict warning in the form: Preferences › Checks › Conflict prediction › When creating a merge/pull request ("Warn in the form").
  • Issue reference: Preferences › Issues. See Configuring issues.
  • Target from the stack and the workflow: Stacks and Hygiene and workflow.

See also