title: Adding a single file to a Subversion repository but not other files along the path
body: <p>The context is that I have an on off-the-shelf CMS which I want to make customizations to; so I want to keep the files I modify under version control, but I don't see the need to put the whole file tree under version control. </p>
  
  <p>My problem is that I need to add a file to be kept under version control which is located a few subdirectories down, but I don't want to add anything else to the repository asides from the file and its parent folders.</p>
  
  <p>To illustrate, say I have the following file in my project:</p>
  
  <p>project/folder1/folder2/file.txt</p>
  
  <p>I want to add file.txt to the repository, and folder1 is under version control but folder2 is not. There are existing files in folder1 and folder2 which I do not want to all put under version control.</p>
  
  <p>Doing an <code>svn import folder1/folder2/file.txt</code> doesn't seem to work, as then I need to check out the file, and even if I delete the local version first, SVN complains that its parent folder exist. I presume that this means that if I use the --force option this would just clobber the contents of these folders.</p>
  
  <p>The problem with <code>svn add folder1/folder2/file.txt</code> is that it requires each parent folder to be in the repository already (I gather from the fact that it can't find the folder2/.svn/entries file), but only folder1 is in the repository. So I figured I could do <code>svn add folder1/folder2</code> first. The problem is that this puts the entire contents of folder2 into the repository, which I don't want. It seems the solution would be to do <code>svn add --depth=empty folder1/folder2</code> which just adds the folder and no contents, but the --depth option is a new feature in Subversion 1.5, whereas I'm using 1.4.2 and it would good to avoid upgrading at this point.</p>
  
  <p>So I'm wondering if there is a way around the lack of a --depth option in older versions of Subversion? Or is there another way of solving this problem" I'm also wondering if perhaps the way I went about setting it up in the first place was not so helpful.</p>