SEARCH

How-To Geek

How to svn add All External Files to Subversion

If you’re working on a project, and you’ve copied in or created a whole bunch of new files, you might find it tedious to manually add each of them. Here’s the quick command you can use instead:

svn status | grep "^?" | awk '{print $2}' | xargs svn add

The svn status part of the command will list out all changes, then we grep for the ? at the beginning of the line indicating that it’s an external file, then run it through awk to grab the filename, and finally pass the lot to svn add using xargs.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 07/23/10

Comments (2)

  1. Tim Snadden

    You could also just use

    svn add * –force

  2. Tim Snadden

    In the comment above ‘force’ is meant to have 2 hyphens before it. It looks like the CMS has ‘fixed’ my comment.

Enter Your Email Here to Get Access for Free:

Go check your email!