Multiple PhpStorm projects within a single folder/repository in sub-folders


Assuming I've a top-level folder which is also the only primary git repository (aka monolith repository)


When I open /uber-project/ I can access all projects and I can easily use git to switch branches, looks 👍 Every time I do autocomplete on code, I get *everything*. I could imagine I run into other annoyances too (e.g. watcher or other custom stuff overlapping from different projects).

When I open only e.g. /uber-project/subproject1-php/ as PS root, I'm working only in this project and can keep all customizations there in. However, I cannot access git from within PS which is important for me.

Is it possible to have /uber-project/ open in PS but only "view" a single project e.g.  /uber-project/subproject1-php/   so the others don't interfere? I know that way I can use git.

I know I can "ignore" directories but there will be a time where I want to work on /uber-project/subproject2-php/, basically "switch" over. Same also for subproject2-nodejs/

There _may_ be times I want to work on everything, too.

The main motivation here is to unify VCS management. Currently all these projects exist with their own .git project but they are growing and having overlapping parts when it comes to new features or refactoring which is also a pain to manage (a change can lead to 3 PRs in 3 separate projects 💥)


Can someone share experience how to work with a structure like this?


I think I found out something:

  • you can have a project being primarily in a sub-folder
  • but have VCS root (git) which is "outside"
  • the commit dialog does show also changes "outside" the project

I've to perform testing with this, but this seems to be what I was looking for.



Yes, this scenario is pretty much valid. Since PhpStorm gets all the information from Git directly, it doesn't matter whether Git root is a level up from current directory as we still can work with our files and paths.

There's request that you might want to see implemented - please vote for it with "Thumb up" button.


Please sign in to leave a comment.