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 ?
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" ?
After enabling required status checks, all required status checks must pass before collaborators can merge changes into the protected branch. After all required status checks pass, any commits must either be pushed to another branch and then merged or pushed directly to the protected branch.
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
The branch is protected, so no one is allowed to push on it.
I assume you mean target branch is protected and my answer is based on that.
To avoid merge conflicts in Gitlab I usually choose one of the 2 options:
git checkout <development branch>
git rebase <target branch>
# optionally interactive rebase, if I have many commits I like to squash them to avoid solving the same conflicts over and over again
# git rebase -i <target branch>
git push -f
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With