How to checkout merge request locally, and create new local branch?

Viewed 44084

I have GitLab repository there and I need to test every merge request locally, before merging to the target branch.

How can I pull/fetch merge request as a new branch?

4 Answers

You can also add the line

fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*

to your .git/config to have git fetch fetch all merge requests.

There is a Check out branch button in GitLab.

enter image description here


Then you can copy comments from Step 1. Fetch and check out the branch for this merge request.

git fetch <repo> <branch>
git checkout -b <branch>

enter image description here

Related