Git - Ignored folders

I had a previous thread about git submodules not being ignored.  That seems to be behaving properly now (since 3.0).

The problem that I am having now is that I am constantly being asked to add files when they are created, that are in an ignored directory.  The folders are ignored within the Git settings of PhpStorm and also in my .gitignore file.  This is seriously irritating.  Please help.

0
5 comments

We can't reproduce this.
Could you please attach the content of your .gitignore file, and given an example of a file which should be ignored but is proposed to be added.

0

We can't reproduce this.
Could you please attach the content of your .gitignore file, and given an example of a file which should be ignored but is proposed to be added.

0
Avatar
Permanently deleted user

Sure!  Attached is my .gitignore file.

The files that are creating a major headache for me are located in the app/cache, web/css and web/js folders.  I believe that the first time I ran assets:install and assetic:dump in which files were to be created in the web/css and web/js directories, the gitignore file was not updated with those directories.  However, I never accepted the files to be added to the repo and, the app/cache folder has always been listed.

When I clear the cache or install assets or dump assetic files, I do not want to be asked about adding files that are in ignored folders.  More so, when I dump assetic files, I do not want files that are ignored to be added to my repo so that I then have to remove them from my commits.

I really enjoy PhpStorm and am thankful for the great integration with Git.  I hope this is something that can be resolved.  It is quite a hassle and distraction having to make sure these files do not get into my commits.
Thanks!



Attachment(s):
.gitignore.zip
0
Avatar
Permanently deleted user

If these directories were added to git app/cache, web/css and web/js
by either you or the editor, then even if they are ignored in your gitingore file this will still happen because git thinks they should be commited.

This is the way git functions, you need to remove them from the git cache.

You need to issue a command to do this
git rm --cache <file path|dir path>

I believe recursive works also
git rm -R --cache <file path|dir path>

Then commit the results.
After this you should not have this issue. (Unless it is a bug in phpstorm) But I don't recall this happening to me.

0
Avatar
Permanently deleted user

This is the command I ran:
git rm -r --cached <file path|dir path>

I have worked multiple days without any problems, so I do apologize for my ignorance of git's behavior.
Thank you, so much, for your consideration!

0

Please sign in to leave a comment.