teh bigbro blog(tm)
Bigbro's foray into the scary world of blogging

Wed, 06 Feb 2008

Subversion Comparisons

I've recently started moving years worth of material from CVS version control to Subversion (svn). I very much like the idea that I can set up and share a repository securely over SSH, using svn+ssh:// type URLs. I also really like the idea that it keeps track of local changesets - ideal for someone like myself who tends to work on a laptop on trains and buses, away from useful internet connectivity. Until recently though, I hadn't stumbled upon two commands that are incredibly useful to me, for comparing a local checkout against what's last been committed on the server.

svn status [filename]
This gives the status of a local checked out file, as against when it was originally checked out to that local machine. No connection to the SVN server required.

svn status -u [filename]
This compares the status of a local checked out file, as against the currently committed version in the repository. svn status -uv gives more information on committed revision numbers. This requires a connection to the SVN server.

svn diff [filename]
This compares the local files against the revision at which they were locally checked out. No connection to the SVN server is required. While this is useful while working locally, I often want to diff files against the latest version in the respository - particularly when I know someone else might be editing and committing the same file ... or more likely it's me editing and committing the same file from a different computer.

svn diff -r COMMITTED [filename]
svn diff -r HEAD [filename]
This compares the local files against the last committed version / the head node in the respository. It requires a connection to the SVN server.


posted at: 10:12 | path: /technical | permanent link to this entry


copyright © 2005-2008, Gareth Eason