开发者

Does SVN delete files from your repository if you delete on your development box?

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.


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.


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


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.


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.


Or you can do it with PHP if required. See this

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜