I develop on a branch dev
and every couple of weeks want to merge the current state into a branch staging
. It seems I didn't think this through enough, because now that I want to do this for the second time I get a conflict, since the last common ancestor is still from when I split dev
off -- and the first difference was added to staging
in a separate commit.
I used a gitlab merge request in both cases, with the squash commits
box checked.
Is my approach inherently wrong and I need to switch to something different, or is there a way to make it work?
As a picture: The v_0.2
merge fails. What I want is to do is a cherry pick of features 5-7, and I had hoped that gitlab would understand that since I had already merged features 1-4. But it doesn't.
As console output: ffc9a2c
Is both branch's last common parent (apparently, the merge that happened there put that commit properly as the new parent), after which I started the merging scheme I described above. You can see staging
in its entirety from that point onwards. I omitted most of dev
, since it's just really long.
git log from staging:
* 5ac9823 Merge branch 'dev' into 'staging'
|\
| * 50bac27 Code update for v1.rc0.0
|/
* 5f38284 Merge branch 'dev' into 'staging'
|\
| * ffc9a2c Merge branch 'formatting_fix' into 'dev'
git log from dev:
* 176971e Merge branch 'doctest_fix' into 'dev'
|\
| * 4f0a423 Fix bug for doctest in filters.py
.
.
.
* 945d9ab Merge branch 'return_codes' into 'dev' # v1.rc0.0 took place here
|\
| * aed6133 Replace return codes
.
.
.
|
* ffc9a2c Merge branch 'formatting_fix' into 'dev'
|\
| * 0451416 Improving Error Message Quality