Help keeping part of a fork in sync with master and part permanently separate?


I suspect my issue is one of terminology, thus not finding the appropriate documentation, so I’m hoping you can point me in the right direction.

I have a project I’m working on, and I want to make a variant project of it to work on at the same time for a different context. They will share 3 modules exactly, and 2 modules will be project-specific, but based on the same original code. Both repos will have different collaborators, so they each need to be able to get the whole of their project in one go.

If I fork the original project, how do I maintain the connection for Modules 1-3 to the original repo (keeping them up to date when there are new changes in the original repo, potentially submitting pull requests for those modules back to it too), and keep the work on Modules 4 & 5 limited solely to the new/forked repo?

There are some somewhat complicated options, like described here: Advanced Merging – Subtree Merge

That said, maybe it’d make sense to move the shared modules into another repo (or three) for shared development and use them in the projects either as submodules, or by building binary packages and pulling those into the projects.

1 Like

Thank you - some very useful directions for me to go and investigate. Thanks for the help!

1 Like