Cannot commit file that is NOT inside gitignore file

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Cannot commit file that is NOT inside gitignore file



I am trying to allow TeamCity do JavaScript code inspection by following this tutorial: https://blog.jetbrains.com/teamcity/2012/06/javascript-code-inspection-server-side/



The problem is that the first step tells me to Share Scope in WebStorm and then commit it to source control. I have .idea/* added to gitignore file but right underneath to NOT ignore .idea/scopes/* where the necessary .idea/scopes/JavaScript.xml lives.


.idea/scopes/JavaScript.xml



So eventually it looks like this


.idea/*
!.idea/scopes/*



Even with this added to gitignore I still cannot commit my JavaScript.xml file. Has anyone came across this and knows how to fix/commit it?



It looks like the problem is with the !.idea/scopes/* bit because after running git status --ignored I can see .idea/ on the list


git status --ignored


.idea/




2 Answers
2



Try adding a slash before .idea


/.idea/*
!/.idea/scopes/*





Still nothing, I have even gone into project files tree and tried git>commit file but got a message that no changes are detected. Also git add is disabled.
– LazioTibijczyk
Aug 10 at 14:27





you could try stackoverflow.com/questions/11451535/gitignore-is-not-working
– Angelo Ortega
Aug 10 at 14:38



git add -f .idea/scopes did the job


git add -f .idea/scopes





This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
– Greenstick
Aug 10 at 17:29





I am the author and this fixed my problem. File appeared in 'Files to commit'
– LazioTibijczyk
Aug 14 at 8:39






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered