Tech Journal Back to Tech Journal

Using SVN (Cheetsheet)

  1. Import a directory into SVN (this will not do checkout for you! You must do that into another directory):

    $ svn import -m "message" dir_to_import http://server.name/svn_repository_path/new_module_name
  2. Checkout a directory from SVN:

    $ svn checkout http://server.name/svn_repository_path/module_name
  3. Update local copy from server:

    1. Update your copy with server changes

      $ svn update
    2. Discard your changes

      $ svn revert
  4. Commit changes to server:

    $ svn commit [files] [-m 'message']
  5. View what's changes/uncommited:

    $ svn status
  6. Do file operations on your local copy, which on commit will be applied to server:

    1. add new file:

    2. $ svn add file
    3. move a file from A to B

      $ svn mv old_filepos new_filepos
    4. copy a file

      $ svn copy src_filepos dest_filepos
    5. remove a file

      $ svn rm file
  7. Set the ignore filters on a directory:

    $ svn propedit svn:ignore dir_name

    This will open the $SVN_EDITOR, where you can enter patterns for ignoring files, one per line. Such as "*" for all files in that directory (but not subdirectories), or "path/to/file" to ignore the file named dir_name/path/to/file.

    Note: this doesn't seem to work for subdirs. If you want to specify ignore filters for them, then do so directly, and not from a parent-dir.

Last updated on 2007-09-05 09:30:45 -0700, by Shalom Craimer

Back to Tech Journal