SVN ignore all sub-folders with a specified name

9.9k views Asked by At

I would like to ignore a specific named sub-folder from all current and future folders created going 1 level deep.

I have a folder that holds all of the templates I am using to generate files. This folder is itself a collection of folders with the actual templates in them. Something like the following

  • Templates
    • Create
      • magic.template
      • unicorn.template
    • Update
      • fairy.template
      • dust.template
    • ...

My build process iterates through all of the folders and converts the templates into actual files. These get placed into a sub-folder called GeneratedTemp. This results in the following structure.

  • Templates
    • Create
      • magic.template
      • unicorn.template
      • GeneratedTemp
        • magic.actual
        • unicorn.actual
    • Update
      • fairy.template
      • dust.template
      • GeneratedTemp
        • fairy.actual
        • dust.actual
    • ...

What I would like to do is ignore all sub-folders of Templates\XXX that are named GeneratedTemp. Is this possible? And how?

2

There are 2 answers

4
pmod On BEST ANSWER

You can add svn property for folders containing GeneratedTemp. Change directory to /Templates and execute:

svn propset svn:ignore --depth=immediates GeneratedTemp .
svn ci "ignore */GeneratedTemp"

This will set svn:ignore property for all folders in /Templates folder. Note that it will clear all previous svn:ignore properties set for these folders if any (in this case you should use svn propedit).

3
Lindydancer On

It's never a good idea to have un-versioned files or folders inside folders that are versioned. Instead, try to find a directory structure where all generated files are placed somewhere outside the source tree.