Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add files to SVN then delete before commit

Tags:

I guess I was careless.

I added a bunch of files to svn with svn add, then I saw a few files added that I didn't want so I deleted them with rm.

Now I can't commit anymore because the commit is missing files. I tried svn cleanup but it didn't help.

My working option now is to manually delete every .svn directory but that seems wrong.

like image 679
Eric Avatar asked Aug 05 '11 14:08

Eric


People also ask

How remove svn added files?

$ svn delete -m "Deleting file 'yourfile'" \ file:///var/svn/repos/test/yourfile Committed revision 15. Use the --keep-local option to override the default svn delete behavior of also removing the target file that was scheduled for versioned deletion.

How do I commit newly added files in svn?

right drag them to the new location inside the working copy. release the right mouse button. select Context Menu → SVN Add files to this WC. The files will then be copied to the working copy and added to version control.

How remove file from svn commit?

To remove a file from a Subversion repository, change to the directory with its working copy and run the following command: svn delete file… Similarly, to remove a directory and all files that are in it, type: svn delete directory…


2 Answers

As I understand it you have this situation:

$ touch foo $ svn add foo A         foo $ rm foo $ svn ci svn: Commit failed (details follow): svn: 'foo' is scheduled for addition, but is missing 

So to fix it do this: (thanks Linus!)

$ svn revert foo Reverted 'foo' 

or you can do this:

$ touch foo $ svn delete --force foo 

for each file, and you should be able to check in without problems.

like image 185
patrickmdnet Avatar answered Oct 14 '22 04:10

patrickmdnet


If you added a folder with sub-folders and files inside then you deleted the folder before you commit it. In this case you can do as the following.

$ svn revert <Deleted Folder Name> --depth infinity 
like image 21
Son Tran Avatar answered Oct 14 '22 02:10

Son Tran