wiki:SubversionCheatsheet

Version 5 (modified by astephen, 9 years ago) (diff)

Added links to svn branch mngmt page

Subversion cheat sheet (basic workflow)

See also: Subversion Branch Management

Set an environment variable, e.g:

export SROOT=svn+ssh://yourname@proj.badc.rl.ac.uk/svn/ndg

For regular use, put it in your .profile (e.g .bash_profile)

Checkout a working copy of the directory you need (in this case "TI01-discovery/trunk/"):

svn co $SROOT/TI01-discovery/trunk/ 

You should only need to do this once, then in future you can use update to check you have the latest version. Update working copy (will replace your local copy with the latest from repository).:

svn update

Make changes:

  • Do some work (really... do some work, change things in your working copy).
  • You may also want to add or remove some files or directories to/from your working copy.
       svn add myfile     or   svn add dir
       svn delete myfile  or   svn delete dir
       svn copy myfile    or   svn copy dir
       svn move myfile    or   svn move dir
       svn mkdir mydir
    

Examine your changes:

  • Compare your local copy to the repository:
       svn diff   or   svn diff myfile   or   svn diff dir
       svn status   or   svn status myfile   or   svn status dir    
    
  • If you like you can throw away your work:
       svn revert myfile (throw away your changes to the file!)
       svn revert --recursive (throw away your changes to entire working directory and subdirectories!!)
    
  • Merge other people's changes with yours:
    svn update
    

If you get a conflict fix it by one of the following:

fix by hand
copy one of three temp files over your own
use svn revert (throw away your work again!)

then use

svn resolved

to tell subversion the conflict is resolved.

Commit your changes:

svn commit 

See also: Subversion Branch Management