# ------------------------------------------------------------------------ # This work is licensed under the Creative Commons # Attribution-Noncommercial-Share Alike 3.0 Unported License. # To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a # letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, # California, 94105, USA. # Permissions beyond the scope of this license may be available by # contacting the copyright owner. # Copyright Ben Balbo # ------------------------------------------------------------------------ # Related files are available at http://benbalbo.com/talks/ # This demo assumes you have a subversion server running locally # with webdav access running at svn.localhost. Based on default # installation on Ubuntu 9.04. # ------------------------------------------------------------------------ # Work in a new directory cd ~ mkdir svn-demo cd svn-demo # create new repository on local machine sudo su www-data -c "svnadmin create /var/lib/svn/test" # check out repository to new directory svn checkout http://svn.localhost/test new ls cd new ls -la # build basic structure svn mkdir trunk svn mkdir tags svn mkdir branches # svn status svn status # check new structure in svn commit -m 'created basic structure' # remove checkout - not needed anymore cd .. rm -rf new ls # checkout trunk for developer 1 svn checkout http://svn.localhost/test/trunk dev1 cd dev1 # create new web site svn mkdir www cd www echo ' index.php # check it all in svn add index.php cd .. svn status svn ci -m 'first website checkin' svn st # new tab - developer 2 svn checkout http://svn.localhost/test/trunk dev2 cd dev2/www cat index.php # dev 2 noticed typo vim index.php svn ci -m 'fixed typo' # dev 1 wants to change the message cd www vim index.php svn ci -m 'changed welcome message' # dev 1 updated working copy svn up # dev 1 diffs and edits then resolves from interactive prompts svn st svn diff # checks in svn ci -m 'changed welcome message' # dev 2 does an update svn up