SVN batch commands for adding or deleting multiple files (Linux)

Here are a few little hints that may help speed up your SVN workflow if you are using SVN in a Linux environment. I found the first one on Snipplr and used that to create the second one for myself.

  1. Deleting multiple missing files (ie. the ones with a “!” next to them):
    svn delete $( svn status | sed -e '/^!/!d' -e 's/^!//' )
  2. Adding multiple new files (ie. the ones with a “?” next to them):
    svn add $( svn status | sed -e '/^?/!d' -e 's/^?//' )
Bookmark and Share

3 Responses  |  add yours »

3 Responses to “SVN batch commands for adding or deleting multiple files (Linux)”

  1. M says:

    The first one returns the following error:

    svn: invalid option character: f

  2. Mark says:

    I am using Windows XP, VisualSVN.
    took the svn file from http://unxutils.sourceforge.net/.

    Using the following lines, after looking at your unix example.

    “c:\Program Files\VisualSVN Server\bin\svn.exe” status | sed -e “/^?/ !d” -e “s/^?//g” > filestoadd.txt

    FOR /F “eol=;” %%i in (filestoadd.txt) do “c:\Program Files\VisualSVN Server\bin\svn.exe” add %%i

    Thanks you very much.
    Mark

  3. Jared says:

    Thanks, this was an excellent tip, exactly what I needed!

Leave a Reply

(if you want a pic to show with your comment, go get a gravatar!)

Search