Blog

How to add directory to svn & ignoring directory contents | Metal Toad

Written by Joaquin Lippincott, CEO | Nov 25, 2008 12:00:00 AM
Filed under:

Metal Toad is an AWS Managed Services provider. In addition to this article on svn we recommend checking out our article on how to host a website on AWS in 5 minutes.

Sometimes when committing things to svn you want to commit a directory, but ignore all of the files inside it. The /sites/default/files/ directory within Drupal is a perfect example. Here's how:

  1. Add the directory, while ignoring all of the files it contains:
    svn add -N [directory]
  2. After adding the directory enter the directory and run the following command:
    svn propset svn:ignore '*.*' .
  3. Commit your changes:
    svn commit -m "Added the directory and set the files within it to be ignored"

All better now...!