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.

This article was written on 07/23/10 Tagged with: Linux

Daily Email Updates

You can get our IT articles in your inbox each day for free. Just enter your name and email below:


Name:
Email:

Leave a Reply

Our Network
About Sysadmin Geek