Take the 2-minute tour ×

As I understand it, the command to ignore the content of a directory using SVN is this:

svn propset svn:ignore "*" tmp/

This should set the ignore property on the content of the tmp directory, right? In other words, the wildcard is set to be the ignore value on the tmp directory. Trouble is, here's what is happening on my Windows box:

> svn propset svn:ignore "*" ./tmp
property 'svn:ignore' set on 'app'
property 'svn:ignore' set on 'config'
property 'svn:ignore' set on 'db'
property 'svn:ignore' set on 'doc'
property 'svn:ignore' set on 'lib'
property 'svn:ignore' set on 'log'
property 'svn:ignore' set on 'nbproject'
property 'svn:ignore' set on 'public'

That's not right. Am I doing something wrong (or perhaps going insane), or is my svn on Windows broken?

Some notes:

> svn --version
svn, version 1.5.2 (r32768)
compiled Aug 28 2008, 19:05:34

Update: I've have just tried this on a Windows XP machine and it works as expected. So either this is a Vista specific issue, or there is a problem with my Vista configuration. Is anyone else able to reproduce this problem on Vista? I have just spotted that Vista isn't listed as one of the supported platforms on the CollabNet downloads page.

share|improve this question
Got the same in my Mac's bash shell, the wildcard is always expanded. If I escape it via "*", it literally ends this way in the svn:ignore property, including the backslash. Using Mac OS X 10.6.3. I have some advanced bash autocompletion scripts installed, not sure if they or some other of my evolutionary added bash config affects this. –  Alexander Klimetschek Apr 14 '10 at 15:13

8 Answers 8

up vote 5 down vote accepted

The command should be working as you expect.

The * is getting globbed, which it shouldn't be doing. So, you're running:
svn propset svn:ignore [value] app config db doc lib log nbproject public ... tmp
(since app was the first folder affected, I'm guessing there's another folder before it).

2 things you can try:

  1. Specify a list file: svn propset svn:ignore tmp -F .svnignore
  2. Just specify the path: svn propset svn:ignore tmp. This should open your default text editor (if configured) to allow you to write and save the list.

Reply to comment

Since you're now attempting to correct the setting, propedit and propdel would work fine -- especially if you have other changes within the directory.

But, if you don't have any other changes to worry about (check svn st), it'll be faster using svn revert -R and svn propset.

share|improve this answer
For your point #2, shouldn't that be propedit, not propset? –  Charles Roper Oct 2 '08 at 11:48
I've accepted this answer. Jonathan gives a clear explanation of what is going wrong (in part - see my own answer for the full explanation) and offers two solutions. –  Charles Roper Oct 2 '08 at 14:10
Thanks Jonathan. Yes, I did LOTS of reverts while trying to troubleshoot this problem. :) Note that you've still got some typos in the first part of your reply. –  Charles Roper Oct 3 '08 at 6:32

For a one-liner to use in shell scripts using the "-F" alternative, simply try this:

echo "*" > .svnignore && svn propset svn:ignore <path> -F .svnignore && rm .svnignore
share|improve this answer

It's reasonable to use a GUI SVN client (unless you're a masochist!). If you're on Windows TortoiseSVN should be you first port of call. Right click on the file you want to ignore then click "TortoiseSVN -> Properties". In the properties dialog you can ignore the entire directory by clicking on the drop down arrow for "Name" and selecting "svn:ignore". Then in the values box just type "*" for all. This is all without the quotes of course.

share|improve this answer

It looks like Microsoft, in their infinite wisdom, have changed the behavior of wildcard expansion in Windows Vista:

So instead of an escaped wildcard being passed in, it gets expanded:

Under Win 95, 98, 2000, XP, the application runs as expected: it does wildcard expansion when parameters are like «*.txt» and it does NOT when parameters are like «"*.txt"». Under Windows Vista, wildcard expansion takes place always, or, said otherwise, double quotation marks DOES NOT suppress it.

There is further discussion on this issue on the Collabnet forum.

share|improve this answer

Which version of subversion are you using?

I tried 1.5.2 on Windows, and it only changed the property on the tmp directory:

[C:\Temp\temp] :svn propset svn:ignore "*" tmp/
property 'svn:ignore' set on 'tmp'


[C:\Temp\temp] :svn proplist *
svn: Skipping argument: '.svn' ends in a reserved name
Properties on 'tmp':
share|improve this answer
See the original question for my svn version. Are you on the same version? –  Charles Roper Oct 2 '08 at 11:36
Also, what version of Windows are you on? –  Charles Roper Oct 2 '08 at 12:20

It sounds to me like the svn.exe binary compiled for windows is doing built-in globbing, which is something that it wouldn't normally do on a unix build because the unix shell is expected to do globbing while constructing the command line. I would consider that unexpected behaviour, especially since you can't seem to work around the globbing.

As others have pointed out, you can supply the * using the -F option or interactively in a text editor.

However, I think you may not be going about this in the easiest way. For ignoring an entire subdirectory, I would do something like this:

svn propset svn:ignore tmp .

This sets the svn:ignore property on . (the current directory, the parent of tmp/) that tells it to ignore the tmp subdirectory and everything underneath it.

share|improve this answer

This doesn't answer your svn question, but why are you trying to ignore all the contents of a directory? It seems to me that if you want a temporary directory at some point in the build, you should make the directory as part of the build instead of it being there from the repo.

Are you trying to ignore it because it's already there and you can't delete it?

Anyway, from my unix command line, this worked for me to ignore untracked file in a diretory called tmp

$ svn --version
svn, version 1.5.1 (r32289)
   compiled Aug 28 2008, 10:00:12

$  svn propset svn:ignore '*' tmp

Is Windows horking your quoting?

share|improve this answer
Yeah, that's a good point. I might well remove it from the repo at some point. It's a Rails app and it gets generated as standard when you create the app (some sub-dirs also get created in there). –  Charles Roper Oct 2 '08 at 12:41

Try it without the trailing slash. Also, the tmp directory itself has to be added to the repository.

share|improve this answer
tmp directory is definitely added to the repo. Removing the trailing slash doesn't make any difference. –  Charles Roper Oct 2 '08 at 7:51

Your Answer


