Adding files to Subversion

I picked up this tip when I was beginning to work with Ruby on Rails and Subversion. I added the following alias to my .profile file

alias svnaddall=’svn status | grep “^\?” | awk “{print \$2}” | xargs svn add’


This command takes all files in the present directory and flags them to be added in the next commit. This saves adding each of the files one-by-one. You don’t just have to use the command for Rails either- use it for everything. I do!

Technorati Tags:
, ,

3 Responses to “Adding files to Subversion”

  1. Thomas Maas Says:

    Hi, correct me if wrong but I believe svn recognizes wildcard characters, so “svn add *” will do.

  2. adam Says:

    Hi Thomas, using a wildcard does indeed work, however it generates warnings for each of the directories and files presently in the directory. The above command works, because it checks the status of each file/folder before adding it.

  3. Thomas Maas Says:

    true :-)