User Tools

Site Tools


svn_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
svn_tutorial [2016/03/29 21:25]
nimas created
svn_tutorial [2016/03/29 22:40] (current)
nimas
Line 1: Line 1:
 ==== SVN Tutorial ==== ==== SVN Tutorial ====
 +=== Starting with SVN ===
 +First lets assume you have a package called **__mypackage__** which contains your codes and header files (i.e., Root, mypackage ...)\\
 +Note that **$SVNUSR** variable should be define in your .bashrc file as \\
 +\\
 +export SVNUSR=svn+ssh://​yourcernusername@svn.cern.ch/​reps/​atlas-yourcernusername/​yourcernusername \\
 +\\
 +Now we want to send **__mypackage__** to the SVN using following steps:\\
 +\\
 +  1- Make a directory (outside of **__mypackage__**). Lets call it **temp**.
 +\\
 +\\
 +  2- Create a local copy of **__mypackage__** inside **temp** directory.
 +\\
 +\\
 +  3- Now we need to create a directory with the same name of **__mypackage__** in the SVN using following command:\\ ''​svn mkdir -m "​message"​ $SVNUSR/​**__mypackage__**''​\\ here instead of **message** you should provide a breif explanation. Note that if you ignore -m "​message"​ option in the above command, an editor of your choice will be activated and you will need to enter the message into that.\\
 +\\
 +  4- Now it is the time to checkout **__mypackage__** into the SVN using:\\
 +''​ svn co $SVNUSR/​**__mypackage__** ​ **__mypackage__** ''​ \\ Instead of '​co'​ you can also use '​checkout'​. At this step, you can actually see your package in the SVN using ''​svn ls $SVNUSR''​ which is empty since we still did not add files inside of **__mypackage__**.\\
 +\\
 +  5- Let's say there is a file at ''​**__mypackage__**/​**Root**''​. We can add this to the svn using two following commands:\\
 +Go to ''​**temp\mypackage**''​\\ ​ ''​svn add **Root**''​\\ ​ you can see the result as '​A ​    ​Root';​ A means Available. \\ ''​svn commit **__mypackage__** -m "​message"''​ \\ you can see the result as '​Adding ​    ​Root'​ \\
 +Now all the files inside ''​**__mypackage__**/​**Root**''​ are in your svn.\\
  
-First lets assume ​you have a package ​called **__mypackage__** which contains your codes and header files (i.e., cmt, Root, ...)\\ +Let's say you have added file called **mycode.cxx inside** ''​**__mypackage__**/**Root**''​ directory to your SVNOnce you make changes in **mycode.cxx** you need to update your SVN using following ​steps:\\ 
-Now we want to send **__mypackage__** ​to the SVN using following steps: +\\ 
-  - Make a directory (outside of **__mypackage__**)Lets call it **temp**. +1Copy **mycode.cxx** into ''​**temp\mypackage\Root**''​\\ 
-  - Create a local copy of **__mypackage__** inside **temp** directory.  +\\  
-  - Now we need to create a directory with the same of **__mypackage__** in the SVN using following ​command:\\ ''​svn mkdir -m "​message"​ $SVNUSR/**__mypackage__**''​\\ ​here instead of **message** you should provide a breif explanation. Note that if you ignore -m "​message"​ option in the above command, an editor of your choice will be activated and you will need to enter the message into that.\\ +2Before adding your modified code, always update your SVN to the last version ​using \\ 
-  Now it is the time to check-in **__mypackage__** into the SVN using:\\''​ svn co $SVNUSR/​**__mypackage__** ​ **__mypackage__** ​''​ \\ Instead of '​co' ​you can also use '​checkout'​. At this step, you can actually ​see your package in the SVN using ''​svn ​ls $SVNUSR'' ​which is empty since we still did not add files inside of **__mypackage__**. +''​svn ​update''​\\ 
-  - Let's say there is a file at ''​**__mypackage__**/​**Root**''​We can add this to the svn using two following commands:\\  ''​svn ​add **Root**''​\\ ​ you can see the result as '​A ​    ​Root';​ A means Available here. \\ ''​svn commit ​**__mypackage__** ​-m "​message"''​ \\ you can see the result as '​Adding ​    ​Root'​ \\Now all the files inside ''​**__mypackage__**/​**Root**''​ are in your svn. +\\ 
 +If you want you can see the status of your SVN by ''​svn ​status''​. ​The result for this example ​is ' ​M   ​mycode.h' ​which means **mycode.cxx** has been modified. \\ 
 +\\ 
 +3- To add the modified code (i.e.,**mycode.cxx**) use : ''​svn commit -m "​message"''​ \\
  
svn_tutorial.1459286756.txt.gz · Last modified: 2016/03/29 21:25 by nimas