I did not understand /assets
at the end of:
!assets/script/xmutarn.js /assets
The exclamation mark that says "deny" !
ie the file on the line will not be ignored. I believe that to ignore the content of the assets
folder would look something like:
assets/*
If you do this, you will ignore the entire folder (correct me if I'm wrong):
assets/
So it should look like this:
assets/*
!assets/script/xmutarn.js
Another detail, as per @DanielGomes found SOen it is necessary to add !*/
whenever it is sub-directories, apparently it does not have to be at the end as stated in link and link
Basically, we first make a blacklist and then a whitelist
The whole code should look something like:
## Files to ignore
*.gitignore
*.bak
## Archives to ignore
changelog*
/index.php
## Folders to ignore
.idea/
sys/session
assets/*
#Whitelist a seguir
!*/
!assets/script/xmutarn.js
If it does not work, it has a detail, it might be that when using assets/*
it forces ignore the folders also in the case of the ./assets/script
folder, so you can try to make the rules for each folder within ./assets
ao instead of the whole folder.