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?
views:
439answers:
5Did you mean to delete the files?
You can always checkout again, to get the latest svn version, and then do what you need to with the proper svn commands.
If you can undo what you did, then do it (eg move the file back). EDIT: For the case where you are moving files, and you've made changes to those files that, this is (essentially) your only option!
Otherwise you have to do a revert, to revert the changes you've made to the repository, and then use the Tortoise commands.
Just as a note, if you're using Visual Studio, I find Ankhsvn is a really good way to avoid "forgetting" to do it the subversion way -- moving, renaming and deleting all use the svn commands.
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.
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.
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.