views:

198

answers:

4

If I have a development area that I deleted files from a certain folder/directory, when I import them back into the repository on the server, is svn supposed to remove the deleted files on the server too?

For example, I have directory "home" in home I had index.php. This is all on my development machine. At the moment it matches my svn repository which also has index.php in it. I delete the file index.php on my development machine and create a new file named blog.php.

When I import the development back into the repository will svn erase index.php and put in blog.php?

I ask because I tried this with tortoise svn and it did not delete the files i deleted. It didn't even put the new file in until I navigated directly to the "home" folder and imported from there, instead of the top level.

Also, should does SVN only import changed files and folders or everything? Thank you.

+1  A: 

If you delete a file through the subversion client (not simply delete it from the file system), a check-in will mark them as deleted on the server (this allows you to restore them if still needed, but an update will not bring them back).

The same stands for renaming a file - you need to do this through the subversion client and then commit in order for the changes to be reflected on the server.

See svn delete and svn move documentation.

Oded
A: 

To delete files in SVN you have to use the SVN delete command, and than commit.

If you use the filesystem delete, the files will be checked out on next update.

PHP_Jedi
+1  A: 

Simple delete will just delete files locally. Use svn delete index.php to delete and commit to make the changes reflect in repository.

svn delete index.php
svn commit

svn add newfile.php
svn commit
N 1.1
+8  A: 

Deleting files from your local sandbox has no effect on the server. Whenever you do another update, you get back those files.

If you want to remove the files, use svn delete followed by a commit. Even then, the files are not really deleted from the server, you can still restore them if necessary.

With TortoiseSVN use Context Menu in explorer, Tortoise SVN > Delete.

To add new files to the repository, use svn add followed by a commit.

Peter Lang
+1 for pointing out that an updated will bring back the files locally if you do not commit the deletion of those files.
JasCav