gitlab 在线合并解决冲突反向合并的问题

2019-07-09  本文已影响0人  鹅鹅鹅_

由于分支版本管理需要,团队禁止正式测试环境分支(这里称之为500环境)随意合并提交,禁止本地往500分支push代码。如果想把自己的分支合并到500分支进行测试,就需要在线提merge request。等其他人review代码并同意后才会进行合并。

然后遇到的坑就是,A分支提交merge request到500分支,后来发现500分支竟然自动合并到了A分支!

后来才找到原因:

Note: 注意: GitLab resolves conflicts by creating a merge commit in the source branch that is not automatically merged into the target branch. This allows the merge commit to be reviewed and tested before the changes are merged, preventing unintended changes entering the target branch without review or breaking the build.
Gitlab 通过在源分支中创建一个 merge commit 来解决冲突,该分支不会自动合并到目标分支中。 这允许在合并更改之前对合并提交进行审查和测试,从而防止意外的更改进入目标分支,而无需审查或中断构建

意思很明显,产生冲突后并解决后的commit版本是提交在了A分支上,然后等待审核人review,review没有问题才会合并到500......

解决方案也是有很多的:
1、从A切一个分支B,在线合并B到500
2、A在线合并500,完成后再将本地A版本强推

上一篇下一篇

猜你喜欢

热点阅读