# diff against the working directory with git-latexdiff

I use git for my latex document and I want to diff against the working directory.
MWE:

\documentclass{article}
\begin{document}
a
\end{document}


add git-latexdiff to $PATH in .bashrc PATH=$PATH:~/path/to/dir/git-latexdiff/


setup git:

git init; git add .; git commit -m "initial commit"


change content of file from a to aa

git add file.tex; git commit -m "2nd commit"


change content of file from aa to aaa

(use git log to see hashes for commits)

git-latexdiff -v --main file.tex hash1 hash2


(-v is verbose, --main specifies the main file, hashes identify commits)
works just fine.

But when I try to commit against the uncommitted working directory:

user2740$git-latexdiff -v --main file.tex hash1 -- Auto-detecting PDF viewer ... xdg-open. /usr/bin/latexpand Creating temporary directories ... done. Temporary directories: /tmp/git-latexdiff.3840/old and /tmp/git-latexdiff.3840/new Checking out old and new version ...ln: failed to create symbolic link ‘./file.tex’: File exists  version: user2740$ git-latexdiff --version


## Works Now:

Execute only in your desired directory even for version information. (at least for version v1.1.2-1-ga985a4f)

The command git-latexdiff -v --main file.tex hash1 -- just works for me. git-latexdiff does a temporary checkout in a directory with a unique name under /tmp/. Are you using the latest version of git-latexdiff?
• For some reason I used to access git-latexdiff via a symlink in /usr/local/bin, yielding a 'Permission denied' unless using sudo. Adding it in .bashrc solves that problem. I updated the question to the latest version of git-latexdiff. – user2740 May 9 '15 at 14:10
• now i get: fatal: Not a git repository (or any of the parent directories): .git when calling git-latexdiff. calling it in its own directory works however – user2740 May 10 '15 at 16:54
• There was a bug in git latexdiff --version if you installed it other than by git clone-ing the repo. But you anyway need to run git latexdiff from a Git directory, that's the point of the tool. – Matthieu Moy May 10 '15 at 17:29
• My bad. I was testing git-latexdiff --version in an arbitrary directory because I just wanted to see whether the right version was in the \$PATH. I then thought the error message was referring to the git-latexdiff-repo as the value for version is now extracted from there. My MWE works now! Thank you so much for your continued efforts. – user2740 May 10 '15 at 20:05