Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Managing PDFs/binaries with Git or other VCS

I'm working on a LaTeX project at the moment for a "thesis" of sorts, and I figured it would be a safe idea to track the work-in-progress with Git, as it's probably the nicest version-control system I've come across. Now, Git will handle source code files brilliantly, but how well does it handle binary files?

I'm unsure as to whether to track my generated PDFs as well as the *.tex sources. Even though I can regenerate my PDFs from any revision/branch, this can be time-consuming, and it's usually quicker to just bring up the relevant PDF version; will Git handle this? Is there a way to flag explicit versions within a Git repository, and can I set it up so, for example, I can quickly compare the PDF output of today's version with last week's?

Rolling back to a specific branch will overwrite the PDFs, or at the very least, require a recompile; I just want to be able to log my progress and efficiently store it, and in the process be able to back up my work. Git might be my solution, but are there better ones?

EDIT My brother sent me a link to some documentation on tagging, so that solves the versioning part of my question.

like image 706
Robbie Avatar asked Nov 05 '22 00:11

Robbie


1 Answers

I think the best solution will depend on how you are going to use the VCS. If you are going to be frequently doing diffs between PDFs, git probably isn't a great solution.

If you are going to be doing diffs on the LaTeX source and then just glancing at the associated PDFs, git is probably a great choice. The way I'd do this is to use the "bisect" functionality to do a kind of pseudo-diff. Bisect is normally used to do a binary search on the revision history to find a bug. The way it works in bzr, you can give a command to run on each revision that will tell bzr if the bug was present. Just give the two revs you want to view and make evince the command to run.

Personally, I'd be more inclined to only control the actual sources. If your PDFs are taking a long time to compile, fix that problem separately. Are you generating all the PDFs each time you change any source file? Maybe a makefile could solve that?

like image 102
drysdam Avatar answered Nov 09 '22 12:11

drysdam