This [1] stackoverflow answer explains the full detail of what I am attempting, but the piece I am missing is being able to do the equivalent of this command in gitlab:
TL;DR - the setting needs to done on the GitLab server itself, which is discussed in this feature request. I don’t know whether the mentioned workarounds really work. Maybe @Linds or @gitlab-greg can chime in here
I think a combination of Permissions, and Protected branches may help to protect your code from unwanted changes while still granting “force push” capability to certain members. For resolving merge conflicts with a “Use ours” policy, I believe similar results can be achieved using the web IDE’s Resolve conflicts: interactive mode, but this would require a manual review step to resolve each merge conflict.
For a long term solution, I think the feature request that @dnsmichi linked is the best path forward:
I encourage you to contribute to the conversation in the issue comments. We use issues to prioritize work and evaluate demand for new feature requests, and your feedback is valuable.
Thanks for the comment and recommendations. We have implemented permissions and protected branches which greatly reduces the possibility of merging files that we don’t want merged.
A manual step to resolve the conflict always has possibility to go wrong (to err is human!), and it seems a automated solution is close to achievable. Hopefully the feature request will make it on to your roadmap soon!