Subversion fast howto

Example of creating a local svn of apache2

mkdir /data/subversion/apache2
svnadmin create /data/subversion/apache2/

svn import /etc/apache2/ file:///data/subversion/apache2/ -m "initial release"

Checkout for creating a working directory
(this will create a apache2 directory in the current directory and a .svn directory in apache2)

svn checkout file:///data/subversion/apache2/

Now doing some change in a file

edit apache2/apache2.conf
svn status ./apache2/
M      apache2/apache2.conf

See what is changed

svn diff ./apache2/
Index: apache2/apache2.conf
===================================================================
--- apache2/apache2.conf        (revision 1)
+++ apache2/apache2.conf        (working copy)
@@ -1,3 +1,4 @@
+# Added a line of comment for SVN test
 #
 # Based upon the NCSA server configuration files
 #

Update the svn
(do also a checkout again if you want to have latest before working again on this)

svn commit ./apache2/ -m "new release"
svn checkout file:///data/subversion/apache2/ --force

Check log

svn log ./apache2/
------------------------------------------------------------------------
r2 | root | 2008-12-09 13:29:12 +0100 (Tue, 09 Dec 2008) | 1 line
new release
------------------------------------------------------------------------
r1 | root | 2008-12-09 13:21:18 +0100 (Tue, 09 Dec 2008) | 1 line
initial release
------------------------------------------------------------------------

Rollback (remove the -r1 if you need latest version again)

svn checkout file:///data/subversion/apache2/ -r1 --force
U    apache2/apache2.conf
Checked out revision 1.