Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Gitlab MRNew to Visual Studio Code? Get it now.

Gitlab MR

Jason Nutter

|
52,125 installs
| (5) | Free
Manage MRs in Gitlab from VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VS Code - Gitlab MR

VS Code extension for working with Gitlab Merge Requests, supporting both Gitlab.com and Gitlab EE/CE servers.

Features

  • Supports both Gitlab.com and Gitlab CE/EE servers.
  • Configurable default remote (e.g. origin) and branch (e.g. master).

Create MR

Create an MR from VS Code by providing a branch name and commit message.

Workflow

  1. Open the command palette and select Gitlab MR: Create MR.
  2. First, input the name of the branch you want created for this MR. If you are not on your default branch, the current branch name will be autofilled (providing a different branch name will result in a new branch).
  3. Next, provide the commit message for the changes. If nothing is being committed, the last commit message will be autofilled (providing a different commit message will only impact the MR).
  4. If the new branch is different from your current branch, the new branch will be created and checked out.
  5. If the current branch has uncommitted changes, you will be asked if you want to commit the uncommited changes.
  6. The branch will be pushed to the remote specified as gitlab-mr.targetRemote (defaults to origin).
  7. An MR will be created to the branch specified as gitlab-mr.targetBranch (defaults to master) from the new branch.
  8. A message will be shown in VS Code with a link to the MR.

Checkout MR

Checkout out an existing MR from the current repo.

Workflow

  1. Open the command palette and select Gitlab MR: Checkout MR.
  2. Select an MR from the list.
  3. If the branch for the selected MR does not exist on your computer, it will be created and switched to.
  4. If the branch for the selected MR does exist on your computer, it will be switched to.

View MR

View an existing MR in your browser.

Workflow

  1. Open the command palette and select Gitlab MR: View MR.
  2. Select an MR from the list.
  3. The MR will be opened in your browser.

Extension Settings

  • gitlab-mr.accessToken: Access token to use to connect to the Gitlab.com API. Create one by going to Profile Settings -> Access Tokens.
  • gitlab-mr.accessTokens: Access token to use to connect to Gitlab CE/EE APIs. Create one by going to Profile Settings -> Access Tokens.
  • gitlab-mr.apiVersion: Gitlab API version. Note, v4 is the only supported API version, but this setting can be used as an escape hatch in case your Gitlab instance is still on v3.
  • gitlab-mr.targetBranch: Default target branch for MRs (defaults to master).
  • gitlab-mr.targetRemote: Default target remote for MRs (defaults to origin).
  • gitlab-mr.useDefaultBranch: When creating MRs, use default_branch set in repository as target branch.;
  • gitlab-mr.autoOpenMr: Open newly created MRs in your browser.
  • gitlab-mr.openToEdit: Open and edit newly created MRs in your browser.
  • gitlab-mr.removeSourceBranch: When creating MRs, enable the option to remove the source branch after merging.

Access Tokens Example

"gitlab-mr.accessToken": "ACCESS_TOKEN_FOR_GITLAB.COM",
"gitlab-mr.accessTokens": {
    "https://gitlab.domain.com": "ACCESS_TOKEN_FOR_GITLAB.DOMAIN.COM"
}

Links

  • Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=jasonn-porch.gitlab-mr
  • Repo: https://gitlab.com/jasonnutter/vscode-gitlab-mr
  • Known Issues: https://gitlab.com/jasonnutter/vscode-gitlab-mr/issues?scope=all&state=opened&utf8=%E2%9C%93&label_name%5B%5D=Bug
  • Change Log: https://gitlab.com/jasonnutter/vscode-gitlab-mr/blob/master/CHANGELOG.md
  • Github Plugin: https://github.com/jasonnutter/vscode-github-pr
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft