rsync and SVN: A poor man's distributed version control

Posted by Tejus Parikh on September 7, 2007

I probably have too many computers. Often, this leads me to need some version of some source code on one box, that only exists on another. I used to check into a temporary branch, then check out from that branch, but that often leads to unpleasant merge problems. Another thing I’ve tried is just using scp to transfer files, but that can be time consuming with a slow connection or a lot of source. I can’t believe it took me this long to think of it, but the most sensible solution is to use rsync.

To pull the files from the computer with current source to older source navigate to your source directory and type:
rsync -avuz new.source.machine:workspacedir/sourcedir . (don’t forget the .)

To put new changes back, it’s just:
rsync -avuz . new.source.machine:workspacedir/sourcedir

You also might want to add the --delete option if you’ve been doing a lot of refactoring.

Another thing I ran into is that Eclipse doesn’t really like adding new projects directly to the workspace. The work around I’ve found is to make sure the project exists within Eclipse on the machine you want to work on before attempting to rsync.

Related Posts:

Tejus Parikh

Tejus is an software developer, now working at large companies. Find out when I write new posts on twitter, via RSS or subscribe to the newsletter: