I believe many smaller companies faces the same struggle, when developing a module.
At the moment, we develop for Odoo 14, 16 and 17.
We often have parallel development. I believe many can relate!
So, when making improvements in one version, say 16, then there's a desire to have that improvement or feature also in 14 and the 17 equivalent of that module.
We use Git, just like most other companies. But how do you and others solve this issue, with developing on three versions of a module at the same time...!? Of-course, not all code works version independent, but for the code that does work!