Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve Accidentally Deleting, Renaming, or Moving without Using the SVN Commands

If you happen to remove, rename, or delete a file or folder and forgot to use the SVN command to do so in Windows and instead used the file system commands, how do you correct this with TortoiseSVN?

like image 758
PositiveGuy Avatar asked Jul 30 '09 20:07

PositiveGuy


3 Answers

If you deleted a file, but forgot to use the SVN command, then right-click the folder that contained the file and choose "Check for Modifications." In the resulting dialog, the deleted file will show up with status as "missing." There, you can right-click it and choose "delete" for Subversion to understand you want it gone. If you don't want it gone, you can right-click it and choose "revert."

If you renamed, moved, or copied it, then your best bet is to rename/move it back or delete the copy and then use the appropriate Tortoise command correctly. Otherwise you'll lose the history link between the old file and the new file.

like image 121
Nick Meyer Avatar answered Nov 15 '22 07:11

Nick Meyer


Until recently, I also used the techniques that Nick mentioned. However, I just stumbled across a much simpler way to tell TortoiseSVN about a file rename.

To tell TortoiseSVN that a file was renamed, right click the folder that contains it and choose Commit... or Check for modifications. You will see the old file name with status "missing" and the new file name with status "unversioned". Use control-click to select those two file names and nothing else, then right click and choose Repair move. Bam! You're done. See the TortoiseSVN web site for all the details.

As Nick said, you can deal with deleted files in those same dialog boxes. Right click on the missing file and either choose Delete to tell TortoiseSVN you really want to delete it, or choose Revert to bring it back.

like image 43
Don Kirkby Avatar answered Nov 15 '22 06:11

Don Kirkby


Run svn up from the command line or SVN Update from the windows context menu and it will put back any deleted files. Once the files are back in their respective places, you can delete them from the TortoiseSVN context menu and commit the changes.

like image 38
Rudisimo Avatar answered Nov 15 '22 05:11

Rudisimo