views:

195

answers:

4

I am trying to have a folder be checked in, so that when I export from SVN it gets created as part of the exported file hierarchy, so that it will be there for an app (beyond my control) to dump files into. However, I never want its contents to be checked in. How do I have SVN 'track' the folder but ignore its contents?

I'm using TortoiseSVN on win32.

+6  A: 

At the level of that folder, you can add an svn:ignore attribute for * (AKA, ignore everything beneath that folder). That way, developers can check out the folder, but anything they put into it won't be checked back into your repository.

In order to do this in Tortoise SVN:

Right click on the folder > Tortoise SVN > Properties > New...

Set the property name to svn:ignore and the value to *. Apply the property recursively.

JasCav
+8  A: 

Add the folder to Subversion and give it an attribute of svn:ignore set to *.

Adam Crume
That is what I would do but one should realize that this will work as long nobody "actively" adds a file in this folder.
Stefan Egli
With the ignore set, they won't be shown the files in an svn commit action.
Kieveli
yes, but you can still use the "Add" command / context menu
Stefan Egli
Thanks Stefan, that's good to know. I'm the only one working on it ATM so it should be fine for now.
Kev
+3  A: 
  1. Commit the folder
  2. Set the svn:ignore property on the folder to *
  3. Win
Nathan
A: 

once you have something in version control, you cannot ignore it afterwards (why would you, anyway).

what you are asking for is usually for config files, the best practice is to create a config.template. file and have the real config file in the svn:ignore property.

if you just want the folder to be never ignored, put it into svn:ignore. but it won’t be created for you. to create the folder you could use some shell (or batch) script to do this for you

knittl