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
LazioTibijczyk
  • 1,701
  • 21
  • 48

1 Answers1

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

Dmitrii Smirnov
  • 7,073
  • 1
  • 19
  • 29
  • 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. – LazioTibijczyk Aug 28 '18 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. – Dmitrii Smirnov Aug 28 '18 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 – Dmitrii Smirnov Aug 28 '18 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. – LazioTibijczyk Aug 28 '18 at 10:58
  • Found it, my $GIT_DIR/info/exclude doesn't exclude any other files... – LazioTibijczyk Aug 28 '18 at 11:20