I know this has been asked a few times, and I know what I'm asking about is not the Gitlab way, but I have a very specific use-case.
I have 3 branches, DEV, STAGE and MAIN. Each of these branches is a complete version of the site, and each of these branches has a dedicated server and each branch needs to have customized settings. Generally, as code is developed, it's pushed to DEV, and the site is deployed via my runner and tested on the DEV server. Following that, DEV is merged into STAGE, cue the deployment & testing on the STAGE server. Same with STAGE->MAIN.
What's required is the ability to have a fixed-name config file for each environment, each with different settings inside and where performing a merge from DEV->STAGE->MAIN won't overwrite them. In a perfect world, I could pull the config file down from Gitlab with a V4 GET on a branch like STAGE, modify it and push it back up the same way.
An example might be after some A/B testing, I want to enable a feature that's controlled by a key-value pair in configs.json. I want to be able to update this file directly on MAIN and have that change persist, I don't want to have to update the file in DEV and do 2 more merges to push it to MAIN, plus I don't want it activated on STAGE.