title: Trying to use .gitignore file to ignore .log files
body: <p>I am writing in LaTeX and when you save a file in .tex it generate files that I don't want git to track.</p>
  
  <p>The .tex file will make a .log, .aux, .synctex.gz file. I have successfully ignored the .aux and the .synctex.gz with this:</p>
  
  <pre><code>.DS_Store
  *.log
  *.aux
  *.synctex.gz
  </code></pre>
  
  <p>But the log file is still tracked. When I do a git add * it says:</p>
  
  <pre><code>modified:   assets/latex/array/array.log
  modified:   assets/latex/array/array.pdf
  modified:   assets/latex/template.log
  modified:   assets/latex/template.pdf
  modified:   assets/latex/template.tex
  </code></pre>
  
  <p>Also, I have tried this:</p>
  
  <pre><code>.DS_Store
  assets/latex/array/array.aux
  assets/latex/array/array.log
  assets/latex/array/array.synctex.gz
  
  assets/latex/else/else.aux
  assets/latex/else/else.log
  assets/latex/else/else.synctex.gz
  
  assets/latex/elseif/elseif.aux
  assets/latex/elseif/elseif.log
  assets/latex/elseif/elseif.synctex.gz
  
  assets/latex/for-loop/forloop.aux
  assets/latex/for-loop/forloop.log
  assets/latex/for-loop/forloop.synctex.gz
  
  assets/latex/if/if.aux
  assets/latex/if/if.log
  assets/latex/if/if.synctex.gz
  
  assets/latex/switch/switch.aux
  assets/latex/switch/switch.log
  assets/latex/switch/switch.synctex.gz
  
  assets/latex/var/var.aux
  assets/latex/var/var.log
  assets/latex/var/var.synctex.gz
  
  assets/latex/template.aux
  assets/latex/template.log
  assets/latex/template.synctex.gz
  </code></pre>
  
  <p>This also doesn't work.</p>