Delete, move and rename
Subversion allows renaming and moving of files and folders. So there are menu entries for delete and rename in the TortoiseSVN submenu.
Use
When you
If you want to delete an item from the repository, but keep it locally as a non-versioned file/folder, you can use the
If an item is deleted via the explorer instead of using the TortoiseSVN context menu, the commit dialog shows those items as missing and lets you remove them from version control too before the commit. However, if you update your working copy, Subversion will spot the missing item and replace it with the latest version from the repository. If you need to delete a version-controlled file, always use
Retrieve deleted files or directories
If you delete a file or directory and have committed the deletion to the repository, a regular
If you just want to rename the file or folder, use
If you want to move the file in the working copy, for example to a different subfolder, then drag with the right mouse button:
-
Select the file or directory you want to move
-
Drag them with the right mouse button to their new location in the working copy
-
release the right mouse button
-
From the pop-up menu, select
Submit parent directory
Since both rename and move are performed like add followed by delete, you must commit the parent folder of the renamed/move file, so the delete part of the rename/move will appear in the commit dialog. If you don't commit the renamed/moved deleted part, it will remain in the repository and the file won't be deleted when your peers update the working copy. For example, they will have two copies, one old and one new.
You must commit immediately after renaming the folder, and don't change any files in the folder before committing, or your working copy will be really messed up.
Another way to copy or move files is through the Windows copy/move command. First select the file you want to copy, right-click in Explorer and select
You can also use the repository browser to move items around in the repository. Read the "Repository Browser" section for more information.
Don't use SVN to move external connections
You should not use TortoiseSVN's move or rename commands on directories svn:externals
created with . Because this action may cause the external element (item) to be removed from its parent repository, which may annoy others. If you need to move an external directory, you should use the normal shell move, then adjust the svn:externals
properties .
TEST.TXT
In case you have two files with the same name but different spellings (eg: and ) in your repository test.txt
, you cannot update or check out the directory containing the file on the Windows client. While Subversion supports case-sensitive filenames, Windows does not.
It happens occasionally when two people commit on separate working copies with the same file name, only different case. It also occurs when committing files in systems with case-sensitive filesystems, such as Linux.
If that's the case, you have to decide which files in this repository you want to keep and which ones to delete (or rename)
Prevent two files with the same name
There is a server hook script available at: https://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ that will prevent checkins which result in case conflicts.
Sometimes your IDE will rename files because of reflection, but it can't tell Subversion of course. If you try to commit the changes, Subversion will notice that the old files are missing and new files that are not versioned are added. You can simply add new files, but you will lose the history because Subversion doesn't know the relationship of these files.
A better approach is to inform Subversion that this is actually a rename, which you can do in the Commit and Check Changes dialog. Simply select the old file (lost) and the new file (unversioned), use the
Usually you can set your own ignore list in Subversion, eg ignore all generated files. But how do you clean up these ignored projects, resulting in a clean build? Normally you clean up in the makefile, but if you're debugging the makefile, or modifying the build system, then having a cleanup method is extremely useful.
TortoiseSVN offers to clean up the working copy using
When deleting these items, the trash can was used. So if you make a mistake and delete a file that should be version controlled, you can still recover.