Posted by Jason Gill on October 16, 2008

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

Tags: ,

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

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

  1. The first one returns the following error:

    svn: invalid option character: f

  2. 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

Leave a Reply