Search code examples
gitgitlabgit-mergegit-branchpull-request

Resolving a merge request locally with a protected branch


I am using Gitlab, and I have a conflict on my merge request that I cannot resolve with the online tool. I checkout the target branch and resolve the conflict, then ... Then what ?

  • The branch is protected, so no one is allowed to push on it.
  • No option available on Gitlab to do something like this.

What is supposed to be the correct "way" of doing in those cases ? Are we supposed to create another branch to solve the conflict, then another merge request ? Or is there a commmand line / an alternative I failed to see when searching for a solution, like "push the result of the solving conflict which is not a commit per se" ?


Solution

  • Are we supposed to create another branch to solve the conflict, then another merge request ?

    Yes, I'd suggest doing this.

    1) Create a new branch off the destination branch
    2) Merge your feature branch in it
    3) Solve conflicts, add them, and commit the merge
    4) Push that new branch to remote
    5) Create a new PR from the new branch to the destination one