Suppose I have a base project (or framework) which provides features A, B and C. Then I have a second project, which extends the first project and adds feature F to it, and is used on it’s own.
Again, suppose I have a third project which extends the first one and adds feature G to it.
All these three projects can be used separately.
How should one manage this projects in git so that:
- Second and third projects update their own features while getting updates from the first project?
- The code is not duplicated?
For now, I just copy/paste the first project into the second and third project directory (in appropriate place), but this looks so ugly to me.
Any help is greatly appreciated.
git submodules is your way of managing this:
Hope this helps. They get some time to get used to. Versioning of libraries that depend on one another are always tricky.