cfDrinks In Manhattan! | Home | Looking For A Few Good Men (Or Women)

Filed under Quick Tips on February 11, 2008 by Javier Julio

Using svn:ignore Through Command Line Or Subclipse

The documentation for svn:ignore is very confusing if using it through command line. I haven't been able to find any good material on the web so I thought I'd share the steps I've went through to set this up.

Through Command Line

If you have already made your way down to the directory containing the file you want to ignore then use the "svn propedit", not the "svn propset" command. An example:

The directory: /Applications/ColdFusion8/wwwroot/myApplication/
The file to ignore: myFile.html

Steps to follow:

  1. Enter command:
    cd /Applications/ColdFusion8/wwwroot/myApplication/
  2. Enter command (note that the "." means the current directory):
    svn propedit svn:ignore .
  3. An editor will appear. Type in the file to be ignored. In this case we type "myFile.html" without the double quotes. If you have multiple files just put each one on a new line.
  4. Now we need to commit our changes. Enter command:
    svn commit

Through Subclipse

If you are using Subclipse it's a lot easier. Here are the steps to follow.

  1. Right click on the folder containing the file(s) you'd like ignored and navigate to Team -> Set Property.
  2. In the "Property Name" field enter "svn:ignore" (without double quotes).
  3. Select the "Enter a text property" radio button.
  4. In that textarea type each file you want ignored on a new line.
  5. Hit OK and then commit your changes.

Note that if you want to add another file to be ignored later on once you have completed all of the above you need to go elsewhere. To update the contents of the svn:ignore property do the following:

  1. Right click on the folder that already has an svn:ignore property set and navigate to Team -> Show Properties.
  2. Double click on the "svn:ignore" listing in the table, or right click and select "Modify property" from the context menu. If a row with the name "svn:ignore" doesn't show up then you need to follow the list above to create a new property.
  3. Change any of the existing file names. If you need to add a new one or multiple ones do so with each on a new line.
  4. Hit OK and then commit your changes.

Post a Comment Digg Del.icio.us

Trackback Pings (TrackBack URL for this entry)

http://www.arc90.com/cgi-bin/mt4/mt-tb.cgi/104.

Comments

In Subclipse you can also right-click on the item you want to ignore and choose Team > Add to svn:ignore. This will let you ignore the specific item, or a pattern that matches similar items. It will automatically append the item to the existing property or add a new one.

Mark

Posted on February 11, 2008 4:15 PM by Mark Phippard

Mark,

Thanks for the comment! You got me on that one. I was coming from the perspective of not seeing the file listed which I didn't mention, sigh. I'm on a Mac so any file starting with "." is hidden. But you are absolutely correct you can add a file listed to be ignored easily with that one option. Should have been more clear.

I just threw in the part of Subclipse since its one of my favorite plugins. I'm trying to learn terminal commands so I figured I'd share what I learned with both. Thanks!

Posted on February 11, 2008 5:29 PM by Javier Julio

If you want to edit the property from the command line. Try this:

1) Create a file with current property contents:

svn pg svn:ignore . > props.txt

2) Edit props.txt to contain the new value(s) to ignore. As you pointed out, each must be on a new-line.

3) Now set the new property value:

svn ps svn:ignore . -F props.txt

The -F option lets you read in the value from a file.

Mark

Posted on February 11, 2008 6:15 PM by Mark Phippard

"In Subclipse you can also right-click on the item you want to ignore and choose Team > Add to svn:ignore. This will let you ignore the specific item, or a pattern that matches similar items. It will automatically append the item to the existing property or add a new one"

In my projects Team > Add to svn:ignore is always greyed out. Anybody know why this happens? Its a major pain as i have huge image directories i dont want in version control

Posted on March 4, 2008 7:40 AM by Paul Stewart

Post a Comment:

cfDrinks In Manhattan! | Main | Looking For A Few Good Men (Or Women)