0

I am trying to ignore the main .idea directory and exclude specific files from it I want to commit to VCS. I've found out that ! in front of the ignore 'un-ignores' the file. This doesn't work in my case. Any idea what I should do?

I've tried

.idea/*
!.idea/scopes
!.idea/inspectionProfiles/JSInspection.xml
!.idea/TRIP.iml
!.idea/modules.xml

and

/.idea/*
!/.idea/scopes
!/.idea/inspectionProfiles/JSInspection.xml
!/.idea/TRIP.iml
!/.idea/modules.xml
1
  • 1
    I think you need to unignore !/.idea/inspectionProfiles/.
    – phd
    Commented Aug 28, 2018 at 15:31

1 Answer 1

0

Both syntaxes should work fine. I tried the same on Mac and Windows and it works as expected. Does git status show correct information? Check if the Refresh button in the Local changes in the IDE helps.

Why do you ignore the entire .idea folder, btw? See https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems for the recommended approach

5
  • git status shows changes to .gitignore only but not to .idea/inspectionProfiles/JSInspection.xml (I have made test changes to) which was supposed to be 'excluded' from gitignore. I am excluding whole .idea folder because we have lots of user specific files such as deployment.xml, vcs.xml, dictionaries etc. I don't want to end up excluding them one by one. I'd rather choose what I need. Commented Aug 28, 2018 at 10:50
  • Check if there are exclusions on another level (e.g. in $GIT_DIR/info/exclude files) that override the rules you set. Commented Aug 28, 2018 at 10:56
  • And BTW deployment.xml and vcs.xm are not user-specific - they store project-wide config and should be the same on all machines - see the above mentioned link Commented Aug 28, 2018 at 10:56
  • deployment.xml is, at least in my case as we're storing our own deployment directories which we're working on. I don't want to end up deploying to somebody's directory and messing up whatever they're working on. Commented Aug 28, 2018 at 10:58
  • Found it, my $GIT_DIR/info/exclude doesn't exclude any other files... Commented Aug 28, 2018 at 11:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.