Tech Notes

Useful SVN Commands

A quick reference of everyday SVN commands: checkout, update, commit, ignore, resolving tree conflicts and branching.

Here are some useful SVN commands that I use frequently. The list isn’t complete, and I’ll add to it as I come across new commands.

Check out a repository:

svn co

Update your working copy:

svn up

Commit your changes:

svn commit -m "Message: Bug fixing"

Delete a file or directory:

svn delete

Create a new directory in the repository:

svn mkdir

Show information about the working copy:

svn info

Ignore a directory’s contents so they’re excluded from commits:

svn propset svn:ignore '*'

Resolve a tree conflict in SVN

svn resolve --accept working -R

Run this with the path to the folder that has the tree conflict.

SVN branching

To create a branch from your current working copy, first commit all your changes.

Run the following command to get the SVN server URL:

svn info | grep URL

Then run the following command to create the branch copy:

svn cp http:///trunk http:///branches/1.1 -m "Branch 1.1"