SVN User's Reference


—This page is now maintained at bWiki SVN

Note: for all of the commands below, it is assumed you are operating in the base directory for a given module. I.e., if you're going to checkout something to the "bearclawmakesmehot" directory, it assumes you've made the directory and are currently sitting in it. Getting, I assume, hot.
  1. To initially check out a copy of the code:
    Bearclaw:svn co https://data-store.pas.rochester.edu/svn/orda/bearclaw1/dev
    Sorin's Bearclaw:svn co https://data-store.pas.rochester.edu/svn/orda/bearclaw2/dev
    Bear2fix:svn co https://data-store.pas.rochester.edu/svn/orda/bear2fix/dev
    Documentation:svn co https://data-store.pas.rochester.edu/svn/orda/doc
    After this initial checkout, you should only need to "update" your working version (see below) rather than checkout again.
         You may also checkout a revision other than the current one, via
    Bearclaw:svn co -r N https://data-store.pas.rochester.edu/svn/orda/bearclaw1/dev
    Sorin's Bearclaw:svn co -r N https://data-store.pas.rochester.edu/svn/orda/bearclaw2/dev
    Bear2fix:svn co -r N https://data-store.pas.rochester.edu/svn/orda/bear2fix/dev
    Documentation:svn co -r N https://data-store.pas.rochester.edu/svn/orda/doc
    where N is any number from 1 to the current revision number and [path] stands for one of the repository paths above.

  2. To navigate the repository (see the line-by-line, fancy color-denoted changes between revisions, etc.):
    https://data-store.pas.rochester.edu/cgi-bin/viewcvs/viewcvs.cgi/?root=bearclaw1
    https://data-store.pas.rochester.edu/cgi-bin/viewcvs/viewcvs.cgi/?root=bearclaw2
    https://data-store.pas.rochester.edu/cgi-bin/viewcvs/viewcvs.cgi/?root=bear2fix
    https://data-store.pas.rochester.edu/cgi-bin/viewcvs/viewcvs.cgi/?root=doc
  3. To see what files you've made changes to/left alone/deleted/etc.,
    svn st -v
    returns a verbose list of files and flags, which it comes up with by diffing your filestructure against that which you originally checked out (cf. the next command):
    ? File is completely ignored by SVN.
    ! File is missing or incomplete (moved/deleted without involving SVN)
    M File has been modified by you
     File is the same as when it was checked out.
    For other symbols and other stuff, see the SVN quick reference.
  4. To see if your copy of the code is up to date/to see how your modifications compare to the current repository version,
    svn st -u
    returns the "up-to-date?" status for your files.
         Note that this command, as well as most others, may be performed on the entire working copy/directory structure/module/whatever you want to call it (as in the above) or on a single file, e.g.
    svn st -u arf.f90
    will tell you whether arf.f90 is up to date. Note also that if you delete a directory, doing "svn st -u" will list every file in that directory, pointing out that each has been deleted. To avoid this, you may do
    svn st -uq
    to have it quietly (non-recursively) talk to you.

  5. To make your copy up-to-date,
    svn up
    This will only update files you have not modified, though it will also add back files you've non-SVN'ly deleted (see below). It will attempt to merge files you've modified, and most likely will stop and tell you about the conflict.

  6. To quickly view your working copy revision,
    svn info
  7. To see the log of commit-comments for a copy,
    svn log
    svn log -r N
    where the former will return the entire comment log, and latter the comment log of revision N. To see the log of commit-comments for a copy in the repository, simply specify the repository path,
    svn log https://[path]
    This would hopefully be helpful when you realize there's a new version but you don't know why.

  8. To commit/checkin your changes:
    svn ci -m "Details about what you're checking in (keep in quotations)."
    --OR--
    svn ci
    If you have the environmental variable $EDITOR or $SVN_EDITOR set (e.g. in ~/.bashrc, "export SVN_EDITOR=nano"), doing the latter will allow you to give more complete details about the commit, wehereas the former is useful probably only for one-line comments. (If neither of those variables is set, when you try to do the latter SVN will complain and not do the commit.)
        If you try to do a commit with an out-of-date working copy, SVN will not do it and will tell you you're out of date.

  9. Usually you can use the checked-out copy as you would normally. However, if you plan on committing any change other than modifying an existing file -- moving files, deleting files, adding files, etc. -- you must do the changes within SVN in order for it to recognize them. This involves simply prepending the usual command with svn, e.g.
    svn rm arf.f90
    will remove arf.f90 within SVN's structure so that when you checkin, that file will no longer exist in the revision.
        If you simply do "rm arf.f90", when you checkin it will allow the checkin, ignoring the fact that that file mysteriously disappeared and keeping arf.f90 in the revision. Similarly, as mentioned above, if you subsequently do an update, it will restore arf.f90 to your working copy.


Updated: March 16, 2006