Subversion (SVN) Cookbook

Options

  • specify a username:  svn --username joe

Chekout

  • svn checkout protocol://repository/url
    • file:// Local machine
    • http:// HTTP
    • https:// HTTPS (SSL)
    • svn:// SVN (svnserve)
    • svn+ssh:// SVN over SSH

checkout only a subdirectory

  • svn co –depth=immediates https://repository/url/

checkout using a proxy

  • configure your global section in $HOME/.subversion/servers

Add files

  • svn add *
  • svn add filename
  • svn add filename –force

Update

  • svn up
  • svn up filename
  • svn up folder
  • svn up -r42 //update to revision 42//

Merge

  • cd branches/trunk/
  • svn commit
    • Committed revision 500.
  • cd branches/stable
  • svn merge -c 500 ../trunk
  • svn commit -m “merge revision 500 from trunk”

relocate

  • svn switch –relocate https://svn.domain1.com/svn/project/trunk https://svn.domain2.com/svn/project/trunk

properties

  • svn propdel svn:ignore .
  • svn propedit svn:ignore .
  • svn propset svn:ignore “schema.rb” db
  • svn propget svn:ignore -R

Create a branch

  • svn copy trunk branches/1.0