Skip to content

This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!


Subversion

SVN, is a versioning software and a revision control system distributed under an open source license.

Reference(s)

Table of contents


Install

# emerge -a dev-vcs/subversion
# pacman -S subversion
# apt install subversion
# yum install subversion
# dnf install subversion

TODO


Config

TODO


Use

  • Check out a working copy from a repository:

    $ svn checkout http://some_app.code.com/svn/projectname/
    $ svn co http://some_app.code.com/svn/projectname/
    

    • ... With a different username:
      $ svn checkout --username plop http://some_app.code.com/svn/projectname/
      
  • Bring changes from the repository into your working copy. Otherwise, it synchronizes the working copy to the revision given by the --revision (-r) option:

    $ svn update # w/o revision, it brings your working copy up to date with the HEAD
    $ svn up -r42 # with revision (-r), it synchronizes the working copy to that revision
    

  • Print the status of working copy files and directories:

    $ svn status # prints only localy modified items
    $ svn status --show-updates # -u, prints working revision and server out-of-date info
    $ svn status --verbose # -v, prints full revision info on everu item
    $ svn status --quiet # -q, prints only summary information about local items
    

  • Add files, directories, or symbolic links in your working copy for addition to the repository:

    $ svn add test
    

  • Undo $ svn add (without reverting local edits):

    $ svn rm --keep-local . # . or * or a file name etc.
    

  • Delete an item from a working copy or the repository:

    $ svn delete test0
    $ svn remove test1
    $ svn del test2
    $ svn rm test3
    

  • revert all modifications to exactly match the repository into your working copy (at the root of the SVN project):

    $ svn revert --recursive .
    

  • Send changes from your working copy to the repository:

    $ svn commit -m "commit with this commit message"
    $ svn ci -m "commit with this commit message"
    

  • Display commit log messages:

    $ svn log
    $ svn log path/to/folder/or/file # to get commit messages associated to an item
    

  • Show author and revision information inline for the specified file:

    $ svn blame path/to/file
    

  • Displays the differences between two revisions or paths:

    $ svn diff
    $ svn di
    

  • Resolve conflicts on working copy files or directories: After updating, if SVN indicates that a conflict has been discovered, it should be postpone (-p option), than edited in order remove the conflict markers and resolve the conflict. Finally, the resolve command shall be used to inform SVN about the conflict resolution:

    $ svn resolve --accept=working test # resolution after conflict on file "test"
    


If this cheat sheet has been useful to you, then please consider leaving a star here.