Setting SVN:Ignore on the command line

One of the (only) things I miss in my move to the Mac is TortoiseSVN, a really nice Subversion client which integrates with the Windows shell giving you all the Subversion commands on a right click context menu. SCPlugin for OS X is coming along, and what they have is very nice, but they don’t have it all yet… still, good effort guys, thanks.

One function missing from SCPlugin, and from the Subversion bundle on Textmate, is the ability to easily set the SVN:Ignore property. Setting SVN:Ignore on a file or directory means that SVN will never bother you with trying to add or commit it. I’m always heading for the command line, then getting confused and failing to remember how to do the business… so for my benefit here it is (and embarassingly for my memory it’s actually quite easy):

svn propedit svn:ignore .

This will fire up your assigned editor (you could probably set it to Textmate, but I’m not sure how, so I haven’t), then enter your file patterns and you’re away. (The above command assumes you’re setting svn:ignore on objects in the current directory, otherwise just change the . at the end to a filepath to wherever.)

9 thoughts on “Setting SVN:Ignore on the command line”

  1. Hi Sameet. Good tip about the SVN_EDITOR setting. Unfortunately TextMate doesn’t seem to work for me, I get the error “No changes to property ‘svn:ignore’ on ‘.'” no matter what I do. (Emacs works fine though, and I assume vi would too if I were that way inclined.)

  2. I know this is from a long time ago, but the correct way to get TM to work as your SVN editor is:

    export SVN_EDITOR='mate -w'

    The -w tells mate to “wait” until that document is closed. Otherwise, mate returns immediately and SVN thinks nothing changed. You have to save the temp file that is opened in TM and then close that file.

  3. Thanks for the article and all the comments. I just recently moved to a Mac for my main development machine at work and am relearning svn commands after a love affair with TortoiseSVN on my old windows machine, sigh…

    Setting up TextMate with the argument ‘-w’ worked wonderfully with the svn:ignore command from your article. Thanks a bunch!

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>