尝试使用.gitignore文件来忽略.log文件

时间:2017-01-03 21:43:16

标签: git github latex gitignore

我在LaTeX中写作,当您在.tex中保存文件时,它会生成我不想让git跟踪的文件。

.tex文件将生成.log,.aux,.synctex.gz文件。我已经成功地忽略了.aux和.synctex.gz:

.DS_Store
*.log
*.aux
*.synctex.gz

但仍会跟踪日志文件。当我做一个git add *它说:

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

另外,我试过这个:

.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

这也不起作用。

1 个答案:

答案 0 :(得分:4)

您可以使用**/*.log,其中双星表示递归应用它,因此它将匹配每个子目录。