Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a file be recovered after svn delete?

Tags:

svn

I am trying to figure out if we need to reduce the number of developers having svn admin rights.

1 - If a subversion user accidentally deletes and commits the delete of a file or folder, how can the file be recovered?

2 - If the subversion user has svn admin rights, does svn delete executed on the client behave differently (more permanent)?

Target: svn command line client under Red Hat Enterprise Linux (RHEL) 5.2

like image 816
Ed of the Mountain Avatar asked Aug 30 '10 16:08

Ed of the Mountain


People also ask

How do I recover a deleted file from SVN?

If you have not committed a delete operation to the repository, then use TortoiseSVN -> Revert to retrieve the file. If you have already committed the deletion: Use the log dialogue box to find out the revision of your file. Open the repository browser and switch to that revision.

How do I permanently delete files from SVN?

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…

How do I undo SVN changes?

If you want to undo all changes you made in a file since the last update you need to select the file, right click to pop up the context menu and then select the command TortoiseSVN → Revert A dialog will pop up showing you the files that you've changed and can revert.

What is SVN delete?

svn delete (del, remove, rm) — Delete an item from a working copy or the repository.


1 Answers

Yes, the deleted data can be recovered. Simply determine which revision removed the information, and "reverse-merge" the commit. Something like this:

svn merge -c -12345 working_copy_path
svn commit working_copy_path

The -12345 means "reverse-merge revision 12345".

Note that subversion itself doesn't have any concept of "administrative" users. Users either have or do not have read and/or write permissions to any given path in the repository. Also note that depending on how you access the repository, there may effectively be no authorization at all.

like image 161
Mark Avatar answered Oct 16 '22 07:10

Mark