Let’s say you just created a new Java project in Subversion. You now have an empty directory, and you want to create a directory for your source files. I like to follow Maven directory structure even if I’m not using Maven. Maven says my source files should be under the src/main/java
directory. Since my company is VegiBank.com and this is their foundation project, I want to create the directory src/main/java/com/vegibank/foundation
. I could do this:
$ svn mkdir src
$ svn mkdir src/main
$ svn mkdir src/main/java
$ svn mkdir src/main/java/com
$ svn mkdir src/main/java/com/vegibank
$ svn mkdir src/main/java/com/vegibank/foundation
I have to first create the directory in order to create the subdirectory. However, with the --parents
option, I can replace all of those with a single command:
$ svn mkdir --parents src/main/java/com/vegibank/foundation
That makes the entire directory tree without me creating each single subdirectory one at a time.