When using subversion from the command line, it is helpful to know how to set subversion properties. This is particularly useful when you need to set the ignore properties to things like eclipse project files, or compiled class files, are not checked in by mistake. In order to work with Subversion properties, there are 3 commands that you should be aware of.

svn propset

propset is the first command you should be aware of. This command can be used to set a property to a new value. It is good for when the property only has a single value, like true/false, or a number.
svn propset PROPNAME [PROPVAL | -F VALFILE] PATH...
Example, to set the End of Line hanling for a file, you would use
svn propset svn:eol-style "LF" somefile.txt

svn propedit

propedit is the second command you should be aware of. This command is good when you need to set a property that takes multiple values, especially if they are seperated by a newline. It is the preferred command to use when setting the Ignore property for subversion.
svn propedit PROPNAME TARGET...
When you issue this command, it will open the default editor for your system, and allow you to enter the values for the property. For example, to set the ignore property, you could use the following command, and then enter the names of all of the files/directories you want ignored.
svn propedit svn:ignore .
Using the . will set the property on the current working directory.

svn propget

propget is the third command you should be aware of. You can use this command to confirm that your property has been set correctly.
svn propget PROPNAME [TARGET[@REV]...]
For example, you can confirm your ignore property is set correctly by using the following command.
svn propget svn:ignore

References



Published

17 July 2012

Tags