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
svn st

or

svn status
Add files to subversion
svn add *folder/file.php* *another-folder/file2.php*

or

svn add *.php

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
svn st | grep "?" | awk '{print $2}' | xargs svn add

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)
svn rm *file.php*

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.

svn commit -m"This is my revision commit message. I added/modified...."

or

svn cm -m"This is my revision commit message. I added/modified...."

Leave a Reply

Your email address will not be published. Required fields are marked *