Add Files to Subversion Recursively

Adding a directory and sub-directories to your subversion repo: I’ve seen some wacky solutions to this problem online, and a lot of people don’t know this is a built-in command (Google “add files to subversion recursively”).

Since CodeFury has been getting pretty high in the Google listings, I’ll post the real command. Hopefully subversion users will find my blog before running someone else’s 50 line perl script.

And here it is:

svn add * -- force

It would really be scary to consider what would happen if subversion didn’t have this in it’s toolbox. Rails developers would be in tears any time they ran

script/generate [something]
# Generating n new files in n directories ... 😉

Of course, even that command isn’t as easy as git’s

git add .

I’ve been using git full force lately. I’m not entirely in agreement with Linus Torvalds’ quips on subversion, but I do agree that git is superior to svn in a lot of ways.

Anyway, I hope this post saves someone a lot of typing.

This entry was posted in Uncategorized. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
  • randomfletch

    Just tried “svn add * — force” and it added my “tmp” and “log” files, so it appears to ignore svn:ignore?

  • Dirk Schwarz

    But with this command you re-add all ignored files as well :-(