July 14, 2010

SVN Ignoring Files/Directories

I've been trying to learn more about using command line SVN because I'm not terribly familiar with it, here is a super quick reference guide to the most common/useful SVN commands.

Checking out a repository (with optional username/password flags):

svn checkout [SVN REPO] [LOCAL DIR] --username [USER] --password [PASS]

Copying a clean directory tree (no svn config files or folders):

svn export [PATH FROM] [PATH TO]

Updating/Committing local copy:

svn update
svn commit -m "[MESSAGE]"

Recently, I've also had to figure out how to ignore folders and files that I don't want committed to my repository (ex. local performance profiling data). I found the following useful commands in the SVN Book:

Ignoring files/folders

svn propset svn:ignore bin .
svn propset svn:ignore hello.gif .

Un-ignoring files/folders

svn propdel svn:ignore bin .
svn propdel svn:ignore hello.gif .

Viewing ignored files/folders (and/or editing in an editor of your choice)

svn propget svn:ignore .
svn propedit svn:ignore . --editor-cmd vim