How to test traction request locally from gitlab?

To view / check the request for github pull, you can use the following command:

git fetch remote pull/ID/head:branch_to_use_locally

Here remote is a github project. Learn more about github issues .

What is the appropriate command when using gitlab?

+5
source share
2 answers

It is very similar. Small differences exist because GitLab uses merge requests instead of pull requests from GitHub . This is to create a branch from master and merge with it later.

To test the merge request, all you have to do is get and check the branch sent for merge:

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

There is also a button in each merge request with instructions for checking the differences locally: enter image description here

+3
source

First pull the merge request to a new branch

 git fetch REMOTE merge-requests/MERGE_REQUEST_ID/head:BRANCH_NAME 

Real git fetch origin merge-requests/1/head:add_some_feature example: git fetch origin merge-requests/1/head:add_some_feature

Then check

 git checkout BRANCH_NAME 

The above example would look like this: git checkout add_some_feature

Now check out the new branch.

Important point : BRANCH_NAME is a branch of the merge request source. This is not a target branch.

+2
source

Source: https://habr.com/ru/post/1265128/


All Articles