Avoid pushing .pdf file after running .tex file

Hi all,

Each time I run my .tex file and want to push my changes to the repository, I have to commit and push .pdf file as well, which is annoying. Previously, I didn’t have the same issue with Github. I don’t know what has been changed! To sum up, I only want to push the .tex file and nothing else. Could someone help me with solving this issue?

Thanks in advance,

You can add a .gitignore file to ignore the PDF file, e.g. with this content:

*.pdf

However, git will never ignore files that are already part of the repository, so you still have to delete the existing PDF using git rm.

Tnx for your reply. The point is that I have the .gitignore file with the following content:
*.log
*.out
*.aux
*.blg
*.bbl
*.gz
, but adding .pdf to this list, doesn’t help. Whenever I compile my .tex file, these mentioned files will change the same as .pdf file. These are not in my commits but the pdf file is! Does it mean that each time I want to push my changes, I have to first remove the pdf file? Previously, I had no problems with pdf file being there :frowning:

No, but once a file has been committed to the repository any ignore rules affecting its name are ignored for that file. So you have to do git rm your-file.pdf and commit that. After that a *.pdf ignore rule should work.