Some
information about using the version control system Subversion (svn) at hao:
Set
the following env vars for
the location of the hao repository, and how to access
the repository from a remote machine not on the hao
network via ssh (iris is an
example machine name on the hao network):
On
a local hao machine:
setenv SVN file:///home/tgcm/svn
On
a remote (e.g., CISL) machine:
setenv SVN svn+ssh://iris.hao.ucar.edu/home/tgcm/svn
Now
you can use $SVN in svn commands from local (hao) or remote (e.g., cisl)
machines.
If
you get tired of entering your hao password when
issuing these commands from a remote machine, you can setup unattended ssh for password-less access (an hao sys-admin can help you set this up).
Below
are some common svn commands, which are typed on the
command line.
Most
commands, except for the first few, are executed from an svn working directory. Some
commands operate only locally, others need to access the repository.
See
also the online book: http://svnbook.red-bean.com/
------------------------------------------------------------------------
Commands
that can be executed from any directory:
See
usage description and list of subcommands:
svn help
See
usage statement for the checkout command:
svn help checkout
Checkout
the timegcm1.42 tag (will make local svn working
directory timegcm1.42):
svn checkout $SVN/timegcm/tags/timegcm1.42
Checkout
the tiegcm trunk code (create local working dir tiegcm_trunk):
svn
checkout $SVN/tiegcm/trunk tiegcm_trunk
See
list of projects in the hao repository, or list of timegcm tags:
svn list $SVN
svn list $SVN/timegcm/tags
---------------------------------------------------------------------------
Commands
from here down should be executed in an svn working directory:
See
information about the current svn working directory:
svn info
See
the svn commit log for the current working directory,
providing
a
history of development (most recent commits first).
svn log
svn log | less
svn log >! svn.log
See
status of local files in an svn working directory:
(A "M" in first column means the file is locally
modified)
svn stat
See
local and repository status:
(A
"*" means the file has been modified in the repository)
svn stat -u
See
differences of locally modified files compared to original checkout,
and
optionally redirect output to file svn.diffs:
svn diff
svn diff >! svn.diffs
See
modification diffs of a specific file (or list of
files):
svn diff file.F
svn diff file1.F file2.F file3.F
Revert
a file to the original checked-out version:
(you might want to save the modified file first)
svn revert file.F
Update
a working directory to receive changes from the repository:
(e.g., you saw repository-modified files from the command
"svn stat -u")
Your
local modifications will be preserved, and you will be warned and
given options if there are conflicts.
There should be no need to use
this command in a tag working directory, since tagged revisions are frozen.
svn update
---------------------------------------------------------------------------