MR from dev to main redo all commits, even commit from last MR

Hello everyone.

I have a big problem with our flow.

Here’s what we do now:

  1. I’ve created two branchs: dev (for development and test) and main (our production branch);
  2. I’ve set up the branch “dev” as default branch;
  3. Our dev create a branch from “dev”;
  4. After their changes, they made a push to gitlab and create a MR to “dev”;
  5. We approve (or not) their MR. Our pipeline deploy the changes to our dev server;
  6. After some tests, we create a MR from “dev” to “main”;
  7. After approve and merge (squashing commits), our pipeline deploy the changes to our production server.

The option “Merge method” is set as “Merge commit”.

For some unkown reason (at least, for me :slight_smile: ), the last 2 steps only works for the first time. After the first time, if two commits are sent to “dev”, step 6 shows at least the last 6 commits. It shows even the commits which were already sent from “dev” to “main”.

It also only allow the changes to be made locally.

I really don’t know whats happens here. I think that I’m doing something wrong, but I don’t know what’s wrong.

Can someone help me?

1 Like