Merge Requests
A merge request is a way to propose changes you’ve made in a branch to be merged into another branch, usually the main
branch. This allows others to review your work before it becomes part of the project.
Creating a Merge Request
Push your changes to a branch
-
Make sure your changes are saved and committed to a branch.
Assuming you’re working on a branch called
my-feature-branch
, you can push your changes to the branch using the following command:terminal# confirm you have changes git status # add/stage changes git add . git commit -m "My feature changes" git push origin my-feature-branch
Go to your GitLab project
- Open your web browser and navigate to your GitLab repository.
Start the merge request
- On the left sidebar, click on
Merge Requests
.- You can also find it under Code > Merge Requests if not pinned.
- Click on the
New merge request
button.
Choose source and target branches
- On the Source branch side, click Select source branch dropdown and select the branch where your changes are (eg.
my-feature-branch
). - Beside is the Target branch, click Select target branch dropdown and select the branch you want to merge into (eg>
main
ordevelop
).
Review and add details
- Enter a title and description for your merge request. Be clear about what changes you’ve made and why.
- This usually comes prefilled from the commit message you created when you pushed your changes.
- You can also assign reviewers, add labels, or set a milestone if needed.
Create the merge request
- Click the “Create merge request” button.
Wait for review and approval
- Your merge request is now created! You can wait for feedback, comments, or approval from your team before the changes are merged.
Here’s a demo showing how to create a merge request. Click here
Last updated on