Thursday, February 11, 2010

Ignoring Files in Subversion (svn)

I have used the svn:ignore property with propset successfully to tell svn to pay no attention to some files. Here is how:

// Tell subversion to ignore a single item, overwriting
// any existing ignored items.
$> svn propset svn:ignore data .


// Tell svn to set multiple items to be ignored. this
// will open up an editor where you
// will just list the items to ignore, one on each line.
$> svn propedit --editor-cmd vi svn:ignore .


// You can leave off the '--editor-cmd vi' part if you set
// the svn editor in your environment with something like
// this. And vi can be replaced with your favorite editor
$> export SVN_EDITOR='vi'


// To see your properties use
$> svn proplist -vR


// You may also want to delete a property. Use
$> svn propdel svn:ignore data
.
Both of these commands assume I am in the directory where the items I am ignoring exist. That is what the '.' at the end indicates.

No comments:

Post a Comment