Multi Country project setup

Hi,
I’m looking for help on how should I set up my git repository/repositories.

I have a project (let’s call it parent) which is made of multiple modules (a core, a rest-api, a back-end and so forth…).

I need to develop and maintain this parent project in the long run adding new functionalities both in terms of added modules (let’s say I’ll add a mobile-ui one in 6 months) and in terms of features/fixes (updating or modifying let’s say the core module).

At the same time this project is going to be ported to multiple countries, each one applying their own modifications to the modules.

I thought each country could be represented by a clone of the parent project, so that I could end up with a one level hierarchy where each country has the parent as a remote.

I need each country to live on its own, countries should not see each other changes. I also need to have an easy way to port changes made into the parent project into the country specific children, but this must also be a decision taken on a per country basis (no fix or update must be mandatory).

I already tried a couple of approaches, but the number of merge conflicts arising when porting a fix from parent to any country child is enormous.

Any advice would be great, because I’m running out of ideas.

My last attempt was based on feature branches (or git flow, if you prefer):

  • parent master branch is maintained empty to prevent forced updates
  • initial code base in parent is stored in a base branch (just to prevent my stupidity, I know this is not needed and i could have used master)
  • any development in parent occurs on a feature/name or fix/issue-no branch, either forked from the base branch or from any other feature branch
  • countries have parent as remote
  • no push is allowed from the countries to the parent (password protect)
  • any country can pull anything they want from parent and then merge

Issue with the above is the number of merge conflicts is enormous due to the very great differences between the country and the parent project… And that can only get worse due to the nature of the project where each country will progressively diverge in features, but they will still maintain a common architecture!

So, again: help me, please!