Merge Request issues - is our Git workflow bad?


We have three major branches, all relating to an environment - develop (QA), staging (UAT), and master (production).

We create feature branches off of develop and merge them back into develop, which creates pipelines to QA. We have a nightly schedule to keep staging up to date with what is in develop. Staging does some extra work such as code scanning, tests, etc, and deploys to our UAT environment at this time.

When we are ready for a deployment, we create a merge request from staging into master. So, the flow goes develop -> staging -> master.

Our merge requests are whacky. First of all, it tends to show that there are hundreds of commits - the history is certainly inaccurate. But of more concern, we’re running into this issue: If we merge staging into master, and then immediately create an identical merge request, it shows the same exact changes as if the first MR never happened. If there have been some changes, it will show the new changes overlapping with the previous MR changes. This has been creating endless conflicts for us.

Are we doing something wrong? Do we need to push master back onto the lower environments to preserve the history? Gitlab support ensures us that this is not an issue with the product, but with Git or the workflow.

Any help at all would be very, very appreciated. Feels like we’re going crazy here.