SVN command-line

Slik SVN

Basic SVN Commands

#Switches
--m "message text"
--username <username>

#Help
svn help
svn help <command>
#Example
svn help co

#check-out
svn co svn://[@rev]... [path] --username <username>

#check-in / commit - defaults to user who checked-out
svn ci [path...] -m "message text"

#Mime-type
svn propset <propname> <propval> <file path...>
#Examples
svn propset svn:mime-type text/plain <file path>
svn propset svn:eol-style native <file path>

#Add
svn add <dir/file path...>

#Copy - Branch/Tag
WC=Working Copy
WC path -> WC path (copy and sched for addition w/history)
WC path -> URL (immediately commit copy of WC to URL)
URL -> WC path (co and sched for addition)
URL -> URL (branch / tag)
svn cp [src path] [dst path] -m "message"

#Move
svn mv <src> <dest>

#Delete
svn delete <remote url... or local path...>

#update
svn up [path...]
svn up -r <revision>

#Statuses

''=None
A=Added
D=Deleted
M=Modified or properties modified
R=Scheduled for deletion and replaced in WC
U=Updated
C=Conflicted
G=Merged
X=present due to external definitions
I=Ignored
?=Not under version control
~=versioned as one type of object, but replaced as different type of object
L=Locked
S=Item is switched
K=File is locked in this WC
O=File is locked by another user in another WC
T=Locked in this WC, but lock has been stolen and is invalid
Lock is in repository
only appears with --show-updates
*=A newer revision exists on the server


#revert
svn revert [path...]

#cleanup - removes locks, finishes operations
svn cleanup [path...]

#Outstanding changes
svn status [path]

#Current user and revision
svn info

#Restore deleted branch
svn copy svn://host/projects/branches/someBranch@1234 svn://host/projects/branches -m "Restore branch from rev 1234."



Commit template:

svn propedit tsvn:logtemplate .

Set editor in Windows:

set EDITOR=notepad.exe


HowTo Revert trunk/head to older version or use tortoise and right click.

HOTO pull back revision to work on it locally:

For example. Revision 313

Create a patch file by doing the following:

C:\vn>svn diff -r 312:313 > r313.patch

Specify the previous revision up to the revision you want to create a patch for and save it to a file.

Right-click that patch file with TortoiseSVN and apply the patch to your local copy

Comments

Popular posts from this blog

Sites, Newsletters, and Blogs

Oracle JDBC ReadTimeout QueryTimeout