In subversion, how can I un-hijack a file?

自作多情 提交于 2019-12-13 12:26:46

问题


Currently, my team has a set of files that should not be under version control, but they are. I would like to remove them from our subversion repository, and allow everyone to keep their local versions. What is the best way to accomplish this?

Deleting the files removes them from the repository, as well as everyone's local file system. Using the --keep-local flag almost works. It allows me to keep the copy on my machine, deletes it from the repository, but still removes the files from everyone else's file system.

Thanks!


回答1:


After you delete the file, your users will have to recover the file from the repository using svn export.

$ svn export -r x path ./

Where x is a revision where the file existed before it was deleted, path is the full path to the file, and ./ is where the file will be placed.

See svn help export for more information.




回答2:


When you remove it from the repo, it's will end up removing it from the other working copies.

When you do come to putting a new system in place, one technique that usually works quite well is to have the code look for a local file (say config-local.php) which is specifically ignored (and so never gets put into the repository), and a common file that is read in if the more specific one is not found. That would either have a generic configuration, or throw an error to have them create a local version.




回答3:


You can only delete the file, and accept that it gets deleted everywhere. Users can always recover the file from subversion using a subversion export command.




回答4:


Instead of deleting it, move it to some backup filename (in SVN of course). Then set the svn:ignore property on the old name.

The files will be deleted anyway, but nobody will lose their changes.



来源:https://stackoverflow.com/questions/940057/in-subversion-how-can-i-un-hijack-a-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!