Keeping files that are often changed in sync between desktop and laptop
Solution 1:
I think you do not need to add the generated (PDF, dvi or Postscript) files to the version control system; however it makes sense to copy them to a synced directory or other server. I usually make this sort of things with the make
command.
I have a Makefile
like this in the directory where the LaTeX files are (indents are tabs, not spaces). See GNU Make Manual.
%.pdf: %.tex
pdflatex $<
pdflatex $<
store_pdf:
cp example*.pdf path/to/synced_directory
upload_pdf:
scp example*.pdf [email protected]:path/to/directory
clean:
rm *.log *.aux *.nav *.vrb *.out *.snm *.toc
If you want to move the files to a synced directory or to a server where you have ssh access, you need to type:
make store_pdf
make upload_pdf
If you want to generate the example1.pdf from example1.tex, you need to type:
make example1.pdf
If you want to remove the files you do not need, you need to type:
make clean
Solution 2:
You already use git, to that makes things easier. A solution here would be to use 2 git repositories, one that is synced by Ubuntu One and one that is not. You can then push your changes to the synced folder when, and only when, you want the synchronisation to happen.
You probably want to keep the version in ~/Documents synced along with all of your other documents (enable Ubuntu One sync for ~/Documents if you haven't already), so create a clone in a non-synced folder:
mkdir ~/nonsynced
cd ~/nonsynced
git clone ~/Documents/LATEX_PROJECT
You can then work on the files in ~/nonsynced/LATEX_PROJECT. When you want to synchronise, push to ~/Documents/LATEX_PROJECT:
git push ~/Documents/LATEX_PROJECT
If you then work on another synchronised computer you can get the up to date version by running:
git pull ~/Documents/LATEX_PROJECT
from ~/nonsynced/LATEX_PROJECT.
You will need to replace LATEX_PROJECT with the name of your version controlled folder in ~/Documents.