Skip to content

Latest commit

 

History

History
73 lines (61 loc) · 2.24 KB

Subversion-CheatSheet.md

File metadata and controls

73 lines (61 loc) · 2.24 KB

Subversion Cheat Sheet

Revert the change to a single file

$ svn merge -r HEAD:PREV <file>

Related: How do I return to an older version of our code in Subversion?

Commit with a changelist

$ svn changelist my-changelist mydir/dir1/file1.c mydir/dir2/myfile1.h
$ svn changelist my-changelist mydir/dir3/myfile3.c etc.
... (add all the files you want to commit together at your own rate)
$ svn commit -m"log msg" --changelist my-changelist

Review changelist

$ svn status

--- Changelist 'math-fixes':
        button.c
M       integer.c
M       mathops.c

Source: SVN - How to commit multiple files in a single shot
Reference: svn changelist (cl)

Simulate Git Stash

svn diff > patch_name.patch; svn revert -R .    # git stash
patch -p0 < patch_name.patch                    # git stash apply

Source: Temporarily put away uncommitted changes in Subversion (a la “git-stash”)
See also: Using patch as a subversion stash by Jay Fields

Update Repo URL

$ svn relocate https://sub.someaddress.com.tr/project

Change SVN repository URL

SVN Result Codes

$ svn help status
  The first seven columns in the output are each one character wide:
    First column: Says if item was added, deleted, or otherwise changed
      ' ' no modifications
      'A' Added
      'C' Conflicted
      'D' Deleted
      'I' Ignored
      'M' Modified
      'R' Replaced
      'X' an unversioned directory created by an externals definition
      '?' item is not under version control
      '!' item is missing (removed by non-svn command) or incomplete
      '~' versioned item obstructed by some item of a different kind

The StackOverflow article also has an helpful one-liner.

svn help status | grep \'\?\'
svn help status | grep \'\!\'
svn help status | grep \'\YOUR_SYMBOL_HERE\'

What do the result codes in SVN mean?