Search code examples
gitbranchgit-branchgit-stashgit-fork

Are parallel branches the best way to manage similar projects which share code?


I have two projects (Product-line A and Product-line B) which share about 90% of the same code. I want to migrate both projects to GitHub.

Should I use the common code as the master branch and create a new branches for product-line A and product-line B? Would there be any disadvantage to having two parallel branches that I have no intention of merging? The code will need to be used by multiple users from multiple accounts.


Solution

  • Would there be any disadvantage to having two parallel branches that I have no intention of merging?

    No disadvantages: branches aren't always meant to be merged.

    The only issue with that model is to clearly differentiate commits/changes done on the common code from ones done on PA or PB: changing files in PA or PB alone is not enough: you need to check if those changes are part or not of the common code.