I have a software project that is working just fine.
Now, this project has to be adjusted to model a new, but related system.
What strategies are there to keep these two codes well organized?
They will have a codebase that is about 90% the same, but there are many functions which need slight adjustments.

I have thought of the following:

1. Different branches in the git-repository: perfect control of the two projects, but common changes have to be made in each of the branches separately.
2. Modelling different program modes by C++ pragmas (#ifdef Project1 ...):
this keeps the changes local, but makes the code difficult to read.

I am not too satisfied by these solutions. Is there a better approach?