I'm working on a local project with PhpStorm. When I do commits & push with Git, it also takes the .idea
folder and I don't want it.
I added the .idea
folder in the .gitignore
file, but after that :
- The folder was removed remotely (Good)
- When other developers (who also use PhpStorm) take changes on the remote,
.idea
is deleted on their local machine, PhpStorm does not recognize the project folders and does not track the changes of the files anymore (Bad)
On a blog I discovered the command git update-index --skip-worktree </path/to/file>
that ignores changes made locally on a file. It works but the problem with this command is that I have to apply it on every file I want to ignore. PhpStorm regularly creates many files in .idea
and I don't want to manually ignore every single one of them before committing & pushing.
My question is this: Is there a Git command/script or PhpStorm tool that would allow me to :
- Keep a folder only locally for the IDE/local environment
- Ignore this folder and any files it contains when I commit & push
Thank you in advance.