How to setup a multi root git project?
Hello, I am trying to setup a project as following:
Lets assume that there is a WebApp-1, it relies on Framework-1 as well as other Modules, like Module-1
1) WebApp-1
2) Framework-1
3) Module-1
Now I want Framework-1 to be the main git repository for the framework and each part of that framework to be its own module and have its own git repository
Example project structure:
Framework-1.git -> has Directory Modules -> has directory "Framework-Module-1" -> has content of Framework-Module-1.git
Framework-1.git -> has Directory Modules -> has directory "Framework-Module-2" -> has content of Framework-Module-2.git
Framework-1.git -> has Directory Modules -> has directory "Framework-Module-3" -> has content of Framework-Module-3.git
Now when I check out Framework-1 into Project WebApp-1, I would obviously need all files from the framework and all its modules available.
Example:
WebApp-1.git -> Directory Framework -> has content of Framework-1.git (Including content of all modules, eg sub git remotes)
So far I've went thru: https://www.jetbrains.com/help/phpstorm/git-branches-in-multirooted-projects.html
And what I can accomplish is:
Project Framework-1 -> has Directory Modules -> has directory "Framework-Module-1" -> has content of Framework-Module-1.git
Project Framework-1 -> has Directory Modules -> has directory "Framework-Module-2" -> has content of Framework-Module-2.git
Project Framework-1 -> has Directory Modules -> has directory "Framework-Module-3" -> has content of Framework-Module-3.git
But the Framework-1 git doesn't know anything about the modules git repositories, so when I check out Framework-1, the modules are missing.
Then I added the directory of each framework-module to VCS, then pushed. After that I can see in the git log that each framework-module directory refers to the corresponding git repo, however yet again when I checkout Framework-1, the sub directories for all the modules are empty. (eg. no pull from framework-modules git repos)
Can this be accomplished?
Please sign in to leave a comment.
From the IDE, you need to clone every repository individually, especially if all git repositories are independent.
If they are actually git submodules, you could clone the Project using the following command line.
IDE does not support submodules at the moment, so from the UI you will still need to clone them individually.
https://youtrack.jetbrains.com/issue/IDEA-75835