How to fix and solve a broken pipeline in a GitLab merge request (rebase using Terminal)

Опубликовано: 18 Декабрь 2019
на канале: GitLab Unfiltered
12,905
like

➠ GitLab handbook on fixing a broken pipeline in a merge request: https://about.gitlab.com/handbook/git...

###

If you create a merge request during a period where there is an issue in master causing pipelines to fail, you'll notice that failures will continue to occur even if you retry pipeline within the GitLab Web IDE interface.

Once the issue in master is fixed, you can solve this by using terminal to merge the latest version of master into your branch (which you can find in your merge request).

For those who primarily use Web IDE to interface with GitLab, it can feel foreign to engage locally.

➠ Before diving in deeper, be sure to read our GitLab 101 – a primer for the non-technical blog post: https://about.gitlab.com/blog/2019/08...

The process is fairly straightforward once you have completed the necessary steps listed in the GitLab Handbook to edit locally: https://about.gitlab.com/handbook/git...

###

➠ Once you are properly equipped to edit locally, open a terminal window and execute the following.

1. Navigate to the appropriate project. If you've cloned the project to your root directory, try cd www-gitlab-com
2. git checkout master
3. git pull (This brings in the most recent changes from master to your local machine.)
4. git checkout TK (Replace TK with your branch from the merge request. This is easily copied by clicking the Copy Branch Name icon to the right of Request to merge at the top of your merge request page.)
5. git merge master (This takes the changes from master and merges them into your local TK branch.)
6. :q (Entering :q followed by a Return keystroke quits vim which is the editor your terminal opened when adding the stock commit message to the merge.)
7. git push (This takes local machine files and pushes to the cloud.)

Once this has been executed, you'll see new commits added to your merge request, and the pipeline will automatically begin to re-run. If completed correctly, the pipeline will pass now that the latest master was merged into your branch.