Search code examples
gitsoftware-product-lines

git best practices for developing a code for two different devices


I am developing an HTML app that will be 1. compiled using Phonegap Build 2. offered as pure web app on a www server

So the code will be mainly the same but there will small parts dedicated to either the first or second adaptation.

But the improvements on the base code will have to be pushed to both adaptations.

So should I use one git repo and create branches or should I use several repos?

I am new to git so could you please write the workflow commands?


Solution

  • In case you still consider git, the usual way to address "common parts" is to:

    • isolate them in their own repo
    • reference said repos as submodules in a parent repo.

    See Git Submodules.

    That way, you can define two parent repos:

    • one for app1, with a reference to the "common" repo, plus specific developments for app1
    • one for app2, with a reference to the "common" repo, plus specific developments for app2