Secure-Shell (SSH) Reference Sheet – Subversion

Hello, all! This is a continuation of my Secure-Shell Reference Sheet series. This one focuses on interacting with subversion (svn) on a remote/local Linux server.

Check out the others:
Secure-Shell (SSH) Reference Sheet – Basic
Secure-Shell (SSH) Reference Sheet – Database

Check the status of all files

{code}svn st{/code} or {code}svn status{/code}

Add files to subversion

{code}svn add *folder/file.php* *another-folder/file2.php*{/code} or {code}svn add *.php{/code}
Note: Using svn add * inside a directory with items already added to the working copy will result in warnings/errors. It’s best to specify the files, or use the following technique:

Add all files that are not inside the working copy

{code}svn st | grep “?” | awk ‘{print $2}’ | xargs svn add{/code}
This code-bit is featured on my boss Tom Auger‘s website. Check out his site for more great code examples!

Remove file from svn (and directory)

{code}svn rm *file.php*{/code}
WARNING: This will delete the file from the working copy as well as the current folder. Make a backup if you want to keep that file.

Committing to your SVN repository

Any files/folders considered modified (M using svn st) or added (A using svn st) will be committed to the subversion repository. You must supply a revision message, usually describing the changes made in this revision in detail.
{code}svn commit -m”This is my revision commit message. I added/modified….”{/code} or {code}svn cm -m”This is my revision commit message. I added/modified….”{/code}