We recently decided to move from TFVC to Git and I'm trying to find the best way to design our new Git architecture.
Our code is made of independent but tightly coupled modules, let's look at the following projects:
CommonLib1
CommonLib2
ApplicationA
(uses CommonLib1
)
ApplicationB
(uses CommonLib1
& CommonLib2
)
Although CommonLib1
/CommonLib2
are completely independent, almost every new feature for ApplicationA
/ApplicationB
would require modifying CommonLib1
/CommonLib2
.
Moreover, when adding new features we would like to create a single branch that would span between all our projects.
As far as I understand, I'm left with 2 main options:
Create a repo for each project, and add CommonLib1
/CommonLib2
as subtrees in ApplicationA
/ApplicationB
.
Create a single Monorepo for all the projects.
What would be the best Git practice for my situation?
Since CommonLib1/CommonLib2
are closely related with ApplicationA/ApplicationB
, so you’d better use option2 (create a single Monorepo for all projects). The branches structure can be as below:
Lib1
branch: manage/develop/update CommonLib1
in this branch. When it’s updated, you can merge it in appA
and appB
branches.
Lib2
branch: manage/develop/update CommonLib2
in this branch. When it’s updated, you can merge it in appB
branch.
appA
branch: manage/develop ApplicationA
project.
appB
branch: manage/develop ApplicationB
project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With