0

The base directory of a project is LaTeX which contains the .gitignores:

*.aux
*.pdf
*~

Normally, I don't want to have the pdf files since they are generated by the .tex files. However, inside an image directory under LaTeX, the .pdf files are actually images which are imported into the document.

In the img directory, there is the .gitignore file:

*~

so the only thing I want ignored under img is the emacs backup files ending in ~

The .pdf files in img/08testing are being ignored though. Other answers on stack seem to imply that the subsidiary .gitignore should be overriding the parent. What am I doing wrong?

Dov
  • 8,000
  • 8
  • 46
  • 75
  • `*~` in the subdirectory’s gitignore will still ignore that pattern. You might want to try inverting that: `!*~` – poke Jun 09 '16 at 18:41
  • The point is I do not want to ignore *.pdf under img. How do I do that? – Dov Jun 09 '16 at 18:43
  • 1
    Oh, now I get it. Ignore rules are additive, so you cannot just have a new gitignore file that replaces all the rules in the other one. If you want to undo a rule, you have to explicitly allow it by inverting the rule, i.e. `!*.aus` and `!*.pdf` – poke Jun 09 '16 at 18:45

0 Answers0