Add directory structure to SVN, without files
50,018
Solution 1
So sorry, I should've RTFM ...
http://svnbook.red-bean.com/en/1.5/svn.ref.svn.c.add.html
You can add a directory without adding its contents:
$ svn add --depth=empty otherdir A otherdir
Edit: This doesn't work recursively though, is there any way to do that too?
Solution 2
If you want to do it recursively, maybe this will work for you?
find . -type d ! -name '.' ! -path "*.svn*" -print0 | xargs -0 svn add --depth=empty
Solution 3
Late to the party, but
svn add --non-recursive
works non-recusively.
Related videos on Youtube
![fresskoma](https://i.stack.imgur.com/Y1Udo.jpg?s=256&g=1)
Author by
fresskoma
Updated on September 17, 2022Comments
-
fresskoma almost 2 years
Is there a way to add a directory structure to an SVN repository without adding the files contained in the folders?
-
Joyce almost 15 yearsThe problem is that the "svn add" will automatically recurse and include the contents of the directories. You'll need to use 'svn add -N' instead I think to ensure that it only works on the directory and not any files inside.
-
Kyle Brandt almost 15 yearsOh right, as he said, will edit post