How to svn add All External Files to Subversion

By Lowell Heddings on July 23rd, 2010

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
More Articles You Might Like

Enter Your Email Here to Get Access for Free:

Go check your email!