Earlier quoted context omitted.
Currently we have the problem of merges of two working branches occasionally resulting in a broken one. How does one solve that?
Don’t merge. Rebase only. Keep a linear history. When committing, do a ff-only of ‘main’ to your branch. Yes, this forces everyone to rebase before “merging” but in practice, this results in the least amount of failures, tests being run after you resolved any conflicts, etc. If you can use GitHub merge queues, that solves a ton of this, and you can run tests on the final merge before actually merging instead of relyi…
This. It makes life so much simpler. With teams that don't have a lot of experience with git, however, I tend to use the "Squash and Merge" feature, coupled with forcing a linear history.