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
Open the command palette and select Gitlab MR: Create MR.
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).
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).
If the new branch is different from your current branch, the new branch will be created and checked out.
If the current branch has uncommitted changes, you will be asked if you want to commit the uncommited changes.
The branch will be pushed to the remote specified as gitlab-mr.targetRemote (defaults to origin).
An MR will be created to the branch specified as gitlab-mr.targetBranch (defaults to master) from the new branch.
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
Open the command palette and select Gitlab MR: Checkout MR.
Select an MR from the list.
If the branch for the selected MR does not exist on your computer, it will be created and switched to.
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
Open the command palette and select Gitlab MR: View MR.
Select an MR from the list.
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.