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.
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.
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.
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.
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.
Add the folder to Subversion and give it an attribute of svn:ignore set to *.
*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With