I have two branches: qa
and prd
. Initially they are completely the same (qa
is based on prd
).
Step 1: A creates a feature branch f1
from prd
. A completes development.
Step 2: A merges f1
into qa
for testing. Done.
Step 3: A merges f1
into prd
.
Now I want to make qa
and prd
equal again (they seem to be equal from human's perspective but git refuses to recognize as equal because the two merges are separate, this is one thing I think git doesn't really fit our purpose), so:
Step 4: A merges prd
into qa
.
Step 5: A creates a second feature branch f2
from prd
. A completes development.
Step 6: A tries to merge f2
into qa
but sees a conflict.
Question: I would like to avoid the conflict in Step 6. I have other restrictions:
- I cannot promote changes by merging
qa
intoprd
; - I cannot use cherry pick;
- I can accept any answer that can be automated through GitHub Action
- I must preserve history of
qa
(is it even possible?)
All these restrictions might sound strange to you but it is out of my ability to change them.
I did a bit of research and looks like a hard reset of qa
to prd
makes them TRULY equal (in git's perspective) , but this loses all history of qa
. Is there any way to force git to think that they are equal without losing history? Again I'm beginning to think that git doesn't really fit our purposes and I'm trying to shoe-hone it.
There is also a post that looks to be helpful but I'm not 100% sure: Making two branches identical