I'm working on a test suite for our application. My work goes into branch B. Meanwhile someone else is working on branch A.
I want to periodically merge B into A with --squash, and after fixing the conflicts, update B to look like A.
Most importantly, I need git to understand that after I do the above, there should be a new merge base.
I don't want to create a new branch "B_2" after, because I want my history of B to be in one place. (And A does not need to be polluted with work-in-progress commits from B, hence the squash).
I also don't want to rebase all the work in B on top of A, because it's possible that the changes in the original commits of B won't make any sense when replayed on top of a modified code base from A.
My initial attempt was:
git checkout A
git merge B --squash
*fix conflicts, commit*
git checkout B
git merge -s recursive -X theirs A --squash
This lets me have two near identical branch heads, except that the merge-base of the two branches is the original commit from which branch B was split off. Further merges then become a nightmare.
Is there some preferably not too convoluted way of doing what I want?