0

(SOLVED)

Good morning,

I browsed the web in order to search if there is a way to check and commit an updated version of .pdf file compiled through LaTeX. But I don't find any 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 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.

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.

| improve this answer | |
  • 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 '16 at 2:28
  • @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 '16 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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