If you have nested projects, for example:
C:\projects\ubuntu_24_04\projects\mysite
C:\projects\ubuntu_24_04\projects\mysite\www
Both are separate projects in PhpStorm, and you need to store them in Git repositories separately.
If you. e.g. merge branches in Git in the outer project in PhpStorm, the inner project branches will also be merged.
To separate the projects you need to:
1. Add the gitignore to the outer project:
.idea/ www/
2. In the outper project in PhpStorm got to:
- Go to
Settings > Version Control > Directory mappings
- Click on the inner repo
- Click the
"-"
button (Remove) to the remove the repo - Uncheck the
"Enable automatic mapping detection"
checkbox - Click the
Apply
button

The result will be:

Now, when you merge branches in the outer repository, the inner repository will not be affected.