Working with SubVersion

  • SVN a.k.a Subversion is a version control system allows users to keep track of changes made to any type of electronic data, typically source code, web pages or design documents. =>  http://en.wikipedia.org/wiki/Subversion_(software)
  • SVN URI : is an url address where u can access repository, with SVN there many protocol supported besides it’s original protocol(svn) its also support ssh,http+https
  • uri example :
  • https://mysvnserver.net/svn/myroject/dev/servers/trunk/project
  • svn://mysvnserver.net/svn/myroject/dev/servers/trunk/project
  • http://mysvnserver.net/svn/myroject/dev/servers/trunk/project
  • SVN Client
  1. Console Verision : svn  (all OS) =>  http://subversion.tigris.org/project_packages.html
  2.  Integrate with OS :
    • Tortoise SVN (Win32) => http://tortoisesvn.net/downloads
    • KDESVN (linux + KDE)
  3.  Integrate with IDE (Rails IDE) :
    • Subclipse -> Eclipse + RadRails + Subclipse ( RadRails / Aptana) => http://www.aptana.com/
  4.  another client software
    •  RapidSVN (linux)
  • SVN Command
  1. svn help : list all available svn command
  2. svn checkout / svn co : subversion checkout, initial download working dir
  1. how to  : svn co remote_dir_uri working_dir_destination
  2. example : svn co http://mysvnserver.net/svn/myroject/dev/servers/trunk/project
  3. troubleshoot:
    • when it need SVN authentication, add this paramater to your command line => svn co –username <username> http://mysvnserver.net/svn/myroject/dev/servers/trunk/project
  • svn update / svn up : subversion update, update your working dir
  1. how to  : svn up working_dir/file(s)
  2. example : svn up
  3. troubleshoot:
    • when it need SVN authentication, add this paramater to your command line => svn up –username <username>
  • svn commit / svn ci : committing your working dir to repository
  1. how to  : svn ci working_dir/file(s)
  2. example : svn ci
  3. troubleshoot:
    • when it need SVN authentication, add this paramater to your command line => svn ci –username <username>
    • for win32 user you need default editor, add this option to your command line => svn ci –editor-cmd notepad
  • svn cleanup : cleanup locking files, or unsuccessfull commit
  1. how to  : svn cleanup  working_dir/file(s)
  2. example : svn cleanup
  • svn revert  : reverting your working file(s) to versioned
  1. how to  : svn revert working_dir/file(s)
  2. example : svn revert app/controllers/my_friends_controller.rb
  • svn resolved : resolve the conflicted file
  1. how to  : svn resolved file(s)
  2. example : svn resolved app/controllers/my_friends_controller.rb
  3. note    : when you face conflicted file, u can choose to revert it or to resolved it
  •  Get UR project code from SubVersion
  1. do svn co from above tutorial
  2. maintain your code up to date, with svn update
  • Checkin your changes to your project repos
  1. do svn ci like above tutorial
  2. write down in your editor :
    • your issued number #<ticket number>
    • describe your changes
    • describe your addition / fix