tags:

views:

554

answers:

4

Sometimes I include many files in different directories in my project. For now I am adding all files one by one to my project before commit. Is there any Linux terminal command that can add all unversioned files to subversion.

And what if I want to add all files excepting one or two files.

+3  A: 

By default, the svn add command is recursive. Just point it at the top-level directory of your project and it should add any file not already there. You may want to include the --force option, though keep in mind that this will also add files which are otherwise excluded due to svn:ignore (if you don't use svn:ignore, then you won't have any issues).

Amber
+2  A: 

Adds any file with a question mark next to it, while still excluding ignored files:

svn status | grep -v "^.[ \t]*\..*" | grep "^?" | awk '{print $2}' | xargs svn add
svn commit

http://codesnippets.joyent.com/posts/show/45

James Skidmore
A: 

I haven't used svn. But the following should work.

svn add foo/bar.file bar/foo.file

This should add file bar.file in foo directory and foo.file existing in bar directory.

and svn add foo should add all files in foo to the server. The "recursive" flag is set by default.

And to add all files in a directory except for a few (like the files starting/ending with keywords tmp, test etc), I don't think there is a cleaner/simpler way to do it, better write a shell script that does this.

mallik
+1  A: 
svn add --force <directory>

Add is already recursive. You just have to force it to traverse versioned subdirectories.

cletus