How can I semi-permanently lock certain files from being merged.
At my company we have a Gitlab premium subscription, and we are hosted on Gitlab.com
We maintain an internal repository which defines our aws-auto-scaling runners(with docker+machine) as IAC. We have several different runner configurations (they are all auto-scaling docker-machine runners). To keep track of them, in our runner IAC repo we have a branch for each client.
So client A will have a branch [clientA/runner],
client B will have [clientB/runner, clientB/special-purpose-runner, etc.]
We only deploy runners from branches, and we use the master branch as a place to make global configuration changes(there is a change in security groups, we changed the subnet the runners are hosted in, etc.) So if I make a change to master, we will then merge master into each of the client branches at a convenient time so that they use the most up-to-date changes to the code and infra.
My problem is that each of these branches require a different client configuration that is used by Ansible. Client A may want an idle count of 2, while client B might want an idle count of 6. So when we merge the master branch into the client branches, it’s a pain and it’s error prone to have to manually omit the master config file from merging.
There are only a few files on each branch that need this protection, but from what I have found the only way to do this is to lock files from being changed on the master branch. I would like to update the master branch, then merge it into each of the client branches, but omit the config file as well as one other file since these 2 files need to be different depending on the branch.
Is there any way to enforce this? Even a way to loosely enforce it that is easily overridden is fine.
I am eventually going to create automation to merge the changes automatically via a pipeline, in which case I can just cherry pick all files except the ones we wish to omit, but until then I would like to find a way to do this.
Thank you in advance for helping out a git noob.