0

(SOLVED)

Good morning,

I search the web to see if there is a way to check and commit an updated version of a .pdf file compiled through LaTeX. But I couldn't find a solution.

This seems to be possible using something called "git pre-commit hook", do you have any idea how to do this?

Many thanks

Kosen

Ps: I'm on Windows and using TeXmaker

--------------edit 11/01/2016----------------

I had a *.pdf in my .gitignore file which explains why I was not able to see any changes to my .pdf file. You can force a specific file to be tracked like this:

git add -f my_file.pdf

Then every time it is modified, it will be notified in your git management tool.

2 Answers 2

2

You should not use version control for generated files, period.

git can store binary (non text) files, but it is quite bad at it. And asking for e.g. differences between binary files will just give gibberish, unless you go the extra mile to write a specialized "show differences in humanly understandable format". And without such, the whole point of having files under version control is moot. Or almost.

I.e., my lecture notes in LaTeX are under git's control. If I want to see differences between versions, they are apparent in the sources, not in the PDFs.

2
  • Hej thanks for your quick answer :-). I'm writing a report and I wanted to save the generated .pdf only for my advisor who only a the read rights. If I'm doing several modification to this .pdf file, is git storing the difference between all of them (as it's a versioning tool). By doing so I'm I polluting my git repo with various version of a pdf file that I wouldn't need later. Does it exist king a specific command to do something like that in the git repo : -> If pdf more recent, erase the old one and replace it with the new Thanks :-)
    – kosen
    Jan 11, 2016 at 2:28
  • 1
    @vonbrand: I always compile and add the PDF just before commits. That way, when I check out a particular version of the code I know what the PDF looked like at the time. This is expecially helpful because I have to work on multiple machines, each with a slightly different version of *TeX installed, so the generated PDFs can be slightly different for the same source - esp if behaviour changes across package versions.
    – kabZX
    May 8, 2016 at 9:57
0

I solved the problem :

I realised that I had a *.pdf in my .gitignore file which explain why was not able to see any change to my .pdf file. You can force a specific file to be tracked like that :

git add -f my_file.pdf

Then every time is modified, it will be notified in your git management tool.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .