I didn’t understand the /assets
at the end of:
!assets/script/xmutarn.js /assets
The exclamation sign means "denial" !
ie the file on the line will not be ignored. I believe that to ignore the contents of the briefcase assets
would be something like:
assets/*
If you do so you will ignore the whole folder (correct me if I’m wrong):
assets/
So it should stay that way:
assets/*
!assets/script/xmutarn.js
Another detail, as the @Danielgomes found in the Soen it is necessary to add !*/
whenever it comes to sub-directories, apparently it does not need to be at the end as said in https://stackoverflow.com/a/9227991/1518921 and https://stackoverflow.com/a/8025106/1518921
Basically, first we 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 doesn’t work, there’s a detail, it may be that when using like this assets/*
it force ignore the folders also in case the folder ./assets/script
, then you can try to make the rules for each folder within ./assets
instead of the whole folder.
Please place the code here and not in an image. Because you have a space after the file name?
– Sergio
If you have ever committed the file, you will need to
git rm --cached nomearquivo.js
.– Jéf Bueno
Good afternoon Vinicius, don’t post code photos, if it’s code just copy it here, so it makes it easier for people to debug exactly the way you did. Using code photos would only work if everyone had an OCR software, so avoid unless it is something pertinent to the IDE you are using, which is not the case.
– Guilherme Nascimento