Hello,
I have a report which I am writing as a .tex file, and I am editing from two computers (office and home laptop). I use rsync over ssh connection to synchronise between them and all the rssync commands are written in a Shell script.
#synchronise from office computer to home laptop
rsync -auzv user@host://pathtoremote directory/ /pathtolocaldirectory
#and vice versa
rsync -auzv /pathtolocaldirectory user@host://pathtoremote directory/
I run this code, in a shell script, after finishing some part of the work at either machine.
Now, it turns out that I have edited some portion in my laptop yesterday night, and forgotten to do this synchronisation. and came to work today, and edited the same tex file. I realised the mistake , when the generated pdf showed some old content.
Now , I am stuck. If I go home and run this synchronising commnd, it will overwrite the changes I made in my laptop . Basically I have two versions of the same file.
Is there any way, automatically you can use some shell scripting to see which portions were modified in the laptop, and merge the two versions together,. I know that diff command works to find the difference between two files, but is there some better way to do it, I dont understand very clearly the output of diff, but can rsync help in this ?
I should have used some DropBox which automatically syncs, but anyways, how do I solve this ?