I am collaborating with others on code which is version controlled by git. My colleagues have a different version of the environment version from myself, which causes problems for me trying to compile their code directly. I cannot easily upgrade to their version of the environment.
However, it turns out not to be a problem, as a quick and dirty hack, to place the relevant include/setup files in the relevant directory to be able to compile.
I'd like to be able to edit the joint code together with the "hacky" nonstandard setup in a separate git branch, but only push the main code (without the setup/include files which my colleagues should not have to worry about) to the main branch.
I am aware that I could, as a one-off solution, concentrate the setup file additions into a particular part of the history tree and rebase only the part of the history tree which does not contain these additions onto a branch that then gets pushed to master. However, this is a very unstable solution, as I have to keep track of the relevant commits, and in addition I have to do this every time I push to master. Since this is a repeated operation, I am wondering whether there is a proper git idiom or practice which should better be used for such a case.
This question is related, but not identical to the following: