Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPStorm, Vendor and multiple Git roots

I have a project with a composer.json that adds many modules as dependencies, and I want to be able to work on them all in the same PHPStorm project. When I make changes to a file in the vendor directory, and run git status on CLI, I see the differences, however PHPStorm inline tools do not register the changes (no blue line on left sidebar).

If I go in to the project settings and add the particular vendor dependency as a git root, the folder which contains the .git folder, the IDE starts to work as I expect/hope.

However, I don't want to have to repeat this process for all of my dependencies, it feels like too much manual work? Is there a better way?

Update: Still no joy, the 'Show History' button doesn't work when I use vendor as a source.

Here's my project structure:

  • /home/PhpstormProjects/MyProject/.idea
    • (folder kept separate to avoid VCS having to ignore .idea)
  • /home/my-project/htdocs/
    • (Resource Root, which has a .git repo auto-recofnised by PHPStorm)
  • /home/my-project/vendor/modulenamespace/modulename/
    • (multiple modules each with a .git but NOT auto-recognised by PHPStorm)
like image 407
Joseph McDermott Avatar asked Oct 31 '22 11:10

Joseph McDermott


1 Answers

Turns out it's a known issue, due to number of levels deep the .git repos are: https://youtrack.jetbrains.com/issue/IDEA-108316

like image 79
Joseph McDermott Avatar answered Nov 08 '22 10:11

Joseph McDermott