-- YurySmirnov - 09-Jul-2011
SVN check out and check in notes

Checking out

Suppose we want to check out some package e.g. InDetRecExample into scratch0/ on lxplus

Note that scratch0/ must already exist.

First of all let's initialize athena:


Then we should determine the version of InDetRecExample based on athena release:

get_tag InnerDetector/InDetExample/InDetRecExample

For rel 17 please use

cmt show versions InnerDetector/InDetExample/InDetRecExample

(for now it doesn't matter where we are on lxplus)

For rel 20 please use

pkgco.py -s InDetRecExample

Note only the package name is needed, not the entire SVN path! (via)

We search for our athena release version in the list and determine InDetRecExample version - let it be e.g. InDetRecExample-xx-yy-zz

Then we checking out InDetRecExample package:

cd scratch0/

cmt co -r InDetRecExample-xx-yy-zz InnerDetector/InDetExample/InDetRecExample

Note that if you wanna have the latest package version (in trunk, not in older tags) you have to

cmt co InnerDetector/InDetExample/InDetRecExample

Then we compile:

cd scratch0/

source setup.sh (or source setup.csh in case you use C shell)

gmake --quiet

We're ready to run if no errors were shown!

athena ../share/jobOptions.py

See HowToRunInDetRecExample for further details.


If you want to check out a package with neither trunk nor tags (e.g. a note) you can do it like this:

svn co https://svn.cern.ch/reps/atlasgrp/Physics/yourGroup/etc/

or much better


svn co $SVNGRP/Physics/yourGroup/etc/

We need asetup to set $SVNGRP up (just in case: $SVNGRP is svn+ssh://svn.cern.ch/reps/atlasgrp).

Also you can list your SVN directory from lxplus

svn ls $SVNGRP/Physics/yourGrou/etc/

Checking in

Now how to check in if you've made some changes to a package:

First of, you need permissions to commit. Ask your supervisor how you can get them or look SoftwareDevelopmentWorkBookSVN, then make sure all other files in your local package are up to date with svn update as described here. And

cd scratch0/

svn ci -m "your message"

where you change your message to whatever you want so that everyone knows what changes you've made. Note the revision number appeared!

This way you commited to the trunk. Sometimes you want to commit to tag as well (tag is read-only, so after fixing something you'll have to create a new tag). Here we'll need SVN-related environmental variable $SVNROOT so first we need to initialize athena:


And commiting to the tag is done by copying trunk content to new tag:

svn cp $SVNROOT/InnerDetector/InDetExample/InDetRecExample/trunk -r rev $SVNROOT/InnerDetector/InDetExample/InDetRecExample/tags/InDetRecExample-xx-yy-ww -m "your message"


  • rev is revision number that appeared when you've commited to the trunk,
  • InDetRecExample-xx-yy-ww
    is new tag. You can determine what to put instead of xx-yy-ww by checking latest (already existing) tag and increment it by 1,
  • your message - as earlier. Albeit it is better to write here the same you put when commited to the trunk but in fact you can write all you want.

If you want to commit new file(s) (i.e. with brand new name(s) having no previous version in SVN) first of all you should do

svn add myfile.xyz myfile2.abc

This will allow myfile.xyz & myfile2.abc be checked in while next commit. So after that you do svn ci -m "message" as described above.

To delete a file from SVN repository do

svn remove myfile.xyz

New top-level directory in a personal repo

Creating a new dir in my personal repo and filling it with files:

svn mkdir -m "initial import" svn+ssh://svn.cern.ch/reps/atlas-ysmirnov/multicharge_paper2012

cd wherever/you/have/files/you/wanna/copy/to/SVN

svn import . svn+ssh://svn.cern.ch/reps/atlas-ysmirnov/multicharge_paper2012 -m "adding files"

Now delete the local dir and replace it with the one checked out from SVN:

rm -rf wherever/you/have/files/you/wanna/copy/to/SVN

svn co svn+ssh://svn.cern.ch/reps/atlas-ysmirnov/multicharge_paper2012 [your_new_local_dir]

See SoftwareDevelopmentWorkBookSVN for further details.

Edit | Attach | Watch | Print version | History: r18 < r17 < r16 < r15 < r14 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r18 - 2016-06-07 - YurySmirnov
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback