Adding a directory to subversion, and ignoring the directory contents
by Joaquin Lippincott, President & Founder
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:
- Add the directory, while ignoring all of the files it contains:
svn add -N [directory] - After adding the directory enter the directory and run the following command:
svn propset svn:ignore '*.*' . - Commit your changes:
svn commit -m "Added the directory and set the files within it to be ignored"
All better now...!
Comments
Hi there, Would you happen to
Posted by Besnique on . [Reply]
Hi there,
Would you happen to know how to svn add a directory that contains blank spaces in its title? For example:
svn add User accounts
where 'User accounts' is the directory title.
Many thanks and kind regards,
Besnique
thanks
Posted by Conor on . [Reply]
this is exactly what i was looking for, thanks
You can also use --depth=empty
Posted by Ari on . [Reply]
This didn't work for me. I ended up using:
svn add dirname --depth=empty
This doesn't cover sub
Posted by rooby on . [Reply]
This doesn't cover sub directories inside the directory. For that you need svn propset svn:ignore '*' .
Add new comment