tags:

views:

2925

answers:

6

Also, how do I find files which are not under version control?

+20  A: 

To ignore all files with the ending .jpg use:

svn propset svn:ignore "*.jpg" .

If you want to ignore multiple files or folders use:

svn propedit svn:ignore .

This will bring up your text editor so you can enter a list of files or directories to ignore.

To find files that are not under version control:

svn status | grep "^\?" | awk "{print \$2}"

See the SVN cheat sheet for more tips.

P.S. I've answered this myself for future reference.

andyuk
I think there's a typo there, you want svn propset svn:ignore "*.jpg" . not svn propset svn:ignore ''*.jpg'' . (" versus ''). Improperly quoted, the shell will expand *.jpg and svn will give a cryptic error.
You're right, blahdiblah. Fixed.
Blair Conrad
It makes me happy to see awk in use still. :-)
Vince
To find ignored files: svn status -u -v --no-ignore |grep "^I"|awk "{print \$2}"
Christian Madsen
+1 for the cheat sheet reference. Helped me solve my related problem.
Alex B
+2  A: 

svn status will tell you which files are not in svn, as well as what's changed.

Look at the svn properties for the ignore property.

For all things svn ,the Red Book is required reading.

DGM
+1  A: 

You can also set a global ignore pattern in SVN's configuration file.

petr k.
A: 

Also, if you use Tortoise SVN you can ignore via the context menu in explorer too.

itsmatt
A: 

Use the command svn status on your working copy to show the status of files, files that are not yet under version control (and not ignored) will have a question mark next to them.

As for ignoring files you need to edit the svn:ignore property, read the chapter Ignoring Unversioned Items in the svnbook at http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.ignore.html. The book also describes more about using svn status.

Andreas Holstenson
+4  A: 

If you are using TortoiseSVN right-click on file, select TortoiseSVN/Add to ignore list. This will add the file/wildcard to the svn:ignore property.

Svn:ignore will be checked when you are checking in files and matching files will be ignored. I have the following ignore list for a Visual Studio .NET project:

bin obj *.exe *.dll _ReSharper *.pdb *.suo

You can find this list in the context menu at TortoiseSVN/Properties.

artur02