I have the following directory structure and files.
pw-spec/
|-- event_spec.coffee
|-- event_spec.js
|-- integration
| `-- service
| |-- auth_spec.coffee
Create a .gitignore
in pw-spec
in which you insert these two lines:
*.js
*/*.js
Also note that if you already have files tracked in this subdirectory which you want "untracked", you have to make them unknown to the index as such:
git rm --cached path/to/file
For instance, if in directory pw-spec
you can do:
find -type f -name "*.js" | xargs git rm --cached