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.
Got Feedback? Join the discussion at discuss.howtogeek.com
Comments (2)
Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on Google+ if you'd like.
- Published 07/23/10




You could also just use
svn add * –force
In the comment above ‘force’ is meant to have 2 hyphens before it. It looks like the CMS has ‘fixed’ my comment.