0

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 :

  1. The folder was removed remotely (Good)
  2. 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 :

  1. Keep a folder only locally for the IDE/local environment
  2. Ignore this folder and any files it contains when I commit & push

Thank you in advance.

  • Does [this](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) answer your question? – icebp Mar 01 '21 at 11:38
  • Does this answer your question? [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – icebp Mar 01 '21 at 11:39
  • Try this solution: https://stackoverflow.com/a/28069336/8020009. The second part of your problem is quite strange, please check if it reoccurs after trying the suggestion I've linked. – Dmitrii Mar 01 '21 at 17:10
  • Thanks, I'll try – Harrys Crosswell Mar 02 '21 at 11:02

0 Answers0