Tuesday, April 27, 2010

Subversion Quickies

After using Subversion for a couple years now, I still don't feel like I leverage all its capabilities. I'm basically using it as a glorified version of CVS, which was a glorified version of RCS...

Here are some commands I keep coming back to over and over again now and make me feel like I'm actually getting some benefit from Subversion:

svn revert foo.php
svn revert throws out local changes, in this case to foo.php. Useful if you accidentally add foo.php and then want to not commit it.

svn merge -c -r REVISION
svn merge provides an easy way to rollback your changes a single version. Useful if you committed a file incorrectly.

svn copy http://svn.server.com/src/trunk http://svn.server.com/src/branches/foo-pre-bar-feature
Using svn copy it's trivial to take a snapshot of the current source code tree and store it in a subdirectory (in this case, branches). Because no files are actually copied, making these snapshots costs nothing.

No comments:

Post a Comment