Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have Subversion store an empty directory

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.

like image 291
Kev Avatar asked Sep 23 '09 14:09

Kev


People also ask

How do I keep my git directory empty?

To get Git to recognize an empty directory, the unwritten rule is to put a file named . gitkeep in it. Git will see the . gitkeep file in the otherwise empty folder and make that folder part of the next commit or push.

How do you create an empty directory?

Create the new directory by right-clicking (in your system's file tree) on the folder where you want to create the directory, and selecting menu item "New Folder...". When prompted, enter the directory name: Empty.

How do I create a directory in svn repository?

One way is to browse the repository to the place where you want to insert your new directory and right-click and select "Create Folder". Then right click the folder and check it out to the location where you want it. Then copy the directory of files you want to put into SVN into the folder created by the checkout.


3 Answers

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.

like image 85
JasCav Avatar answered Sep 28 '22 11:09

JasCav


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

like image 29
Adam Crume Avatar answered Sep 28 '22 10:09

Adam Crume


  1. Commit the folder
  2. Set the svn:ignore property on the folder to *
  3. Win
like image 26
Nathan Avatar answered Sep 28 '22 10:09

Nathan