Subversion 'unadd'?

I have some files that I want to add to subversion. Instead of wasting my time and adding every single one, I decided to be a smart ass and do:

svn add * 

.. It was a mistake. Is there a way that I can "humiliate" everything? There are about 7 files that I wanted to add ... now he highlighted an additional 500+ automatically generated files that I did not want to add!

I haven't done it yet, hope there is a way to undo it!

+6
svn
source share
6 answers

Do you have any changes besides the added files? ( svn status will tell you - the changed files will be displayed as M , the added files as A - and svn diff will show the details of any changes). If not, then you can simply do:

 svn revert * 

But if you do have changes other than add- ons that will remove them!

(It might be worthwhile experimenting with a few files first :-)

+12
source share
 svn st |grep ^A |cut -c 9- |xargs svn revert 

To check first which files will be canceled without changing anything, delete the last command:

 svn st |grep ^A |cut -c 9- 

Powerful trace commands:

  • svn st will install everything
  • grep ^A will only give lines starting with the letter A to add.
  • cut -c 9- will get the file name from these lines.
  • xargs svn revert will run svn revert for each file name.

If you are on Windows, you will have to download the UnxUtils package or similar, but it's worth it in many powerful shell commands.

+8
source share

you can use

 svn rm --keep-local * 

All files will be stored as is, without return. And unadd for the commit step.

+8
source share

While you just added new things, just do

 svn revert * 

To be safe, first create a local copy of the files.

+1
source share

You can use svn revert -depth = infinity.

It also undoes all local changes in your files, so use them carefully.

0
source share

You can use the following command:

 svn revert 
0
source share

All Articles