Nautatava Navlakha
Nautatava Navlakha

Reputation: 315

Managing multiple projects with git

I have multiple modules in a project say module1, module2, module3. Each project has multiple branches with structure as

project |branch1 . module1|branch1 . module2 |branch1  .  module3|
        |branch2 .        |        .         |branch2  .         |
        |branch3 .        |branch3 .         |         .         |
        |branch4 .        |        .         |branch4  .         | branch4

Project contains a list of modules to take in but the catch is, if those aren't on same branch, the code breaks.

For eg: I can keep the project on branch 1 and will need module1 and module2 on branch1, i don't care about module3 then.

P.S: I cannot keep modules with project as projects and modules are developed by different teams and merging is done by another team for proper testing of code. Also, changing of project or module before might lead to breaking.

P.P.S: Right now, We manually change branches. A visual way will be helpful as there a lot of branches.

Upvotes: 1

Views: 52

Answers (1)

VonC
VonC

Reputation: 1328522

I cannot keep modules with project as projects and modules are developed by different teams and merging is done by another team for proper testing of code

That other team can maintain a global Git repository reprenting your project and the modules checked out at their relevant commit, using git submodules

In each branch of the main project, you can checkout any module you want to any branch you want, allowing for each branch of the main project to reference only the modules needed, and only at the references needed.

Upvotes: 2

Related Questions