Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page includes explanations of terms and commands for Subversion / SVN.

Terminology

remote repository - the remote copy of the code etc. maintained by the Subversion server

repository root - The the base URL of the repository such as svn://svn.freehep.org/hps/

structure node - Any any part of the repository under the root, which can be conceptualized as a directory on a file system, with the repository root as the "/" or root directory.

working copy - Your your copy of an SVN module including local changes

revision - a globally unique number to the repository tagging the state of the repository after a commit (including add, delete, etc.)

commit - Push push your changes to the repository., making a new global revision

revision - A a global revision number tagging the state of the repository after a commit.remote repository

trunk - The copy of the code maintainedtrunk - The remote repositories current revision.remote repository's current revision, similar to "HEAD" in CVS terminology

tag - A a copy of the trunk from some certain point in time, which should not be modified once created.; usually kept in a node called 'tags'

branch - A a fork of the trunk (or some other version of the code) which is for development and can be modified after it is created.; usually kept in a node called 'branches'

merge - To combine combining together two copies of (usually) the same node in order to merge their changes

Commands

All commands below assume that you are in a command shell like bash on Linux and that the current working directory is a local working copy of a structure node that has been checkout out of the repository.

Checkout a structure node

svn co svn://repo/some/dir 

Show information about the repository

...

Check the SVN docs for a full list of all these commands.

Show node contents

svn ls some/relative/path/

or

svn ls svn://repo/some/path/

Synchronize your copy with the remote repository

svn up

Add files to the repository

...

Copy file or directory from one place to another

svn cp src/dir/or/file target/dir/or/file

Create a directory in the repository

svn mkdir path/to/dir

Tips and Warnings

Be careful when using 'svn add' and 'svn commit' without any arguments, either from the command line or from the top-level in your IDE ( e.g. the infamous Team > Commit from an Eclipse project).  This may cause many files to be added to the repository that should not be tracked and will need to be removed.  Once a file is added, it is tracked 'forever' by the repository and not deleted, even though it might be removed in the trunk.

...

Do not be too dependent on the IDE for using SVN in generalSubversion.  Make sure to have a compatible SVN command line client as your IDE (available e.g. where the SVN minor version number is the same as your IDE's "connector" version (Eclipse), so that you are able to execute shell commands.

...