Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to set up a global .gitignore file in my home suitable for working with TeX files. So typical TeX junk files such as *.log, *.aux, *.synctex.gz would go in it.

The next step, however, is ignoring the compiled somefile.pdf if the source file somefile.tex is present. So my question is:

Is there a syntax in .gitignore that I can use to tell it to ignore somefile.pdf only if somefile.tex is present?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

No, I don't see this feature in gitignore man page.

I would rather:

  • ignore all *.pdf in your global .gitignore file
  • run periodically a script updating a .gitignore file in any directory where a pdf file is found without a matching .tex file

    !afile.pdf

That would make the 'afile.pdf' not ignored in that specific directory.

share|improve this answer
    
Not the answer that I hoped for, but "no" is still an answer. Accepting this, thanks. –  Federico Poloni Apr 3 '12 at 9:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.