I have the following directory structure and files.
pw-spec/
|-- event_spec.coffee
|-- event_spec.js
|-- integration
| `-- service
| |-- auth_spec.coffee
There are two approaches for this type of situation, depending on your needs.
One solution is to put
# generated files
*.js
in pw-spec/.gitignore.
The second solution is to put:
/pw-spec/*.js
/pw-spec/*/*.js
/pw-spec/*/*/*.js
and so forth in the main .gitignore file.This approach is brittle if more sub-directories are added.
I generally prefer to put the .gitignore file at the same level as the Makefile which generates the files that I am ignoring.