For example, if the dev branch is behind the build branch when the two branches merge, the merge request can be created. But it is clear that it cannot merge because it is not possible to merge a backward branch into the current branch. In this case, I want to use the.gitlab-ci.yml configuration, To determine if the dev branch is behind the build branch, I wonder, can this be done? How to configure the.gitlab-ci.yml file if possible?
Basically, gitlab attempts the merge using git
to determine if there's a conflict. It actually calls to gitaly to do this.
Basically the process goes like this:
So, if you wanted to do something similar in your CI/CD pipeline, you could use git
(or a programatic API to git in your favorite language) to attempt a local merge of the two branches in order to detect conflicts.