开发者

Removing and ignoring a versioned item, while preserving users' local copies

开发者 https://www.devze.com 2023-01-19 19:15 出处:网络
There is a file, let\'s call it fileToBeIgnored, that is versioned in SVN and shouldn\'t be.I understand that svn:ignore only prevents the addition of files to the SVN repository and already versioned

There is a file, let's call it fileToBeIgnored, that is versioned in SVN and shouldn't be. I understand that svn:ignore only prevents the addition of files to the SVN repository and already versioned files will keep on getting versioned whether they match the pattern or not. I'm perfectly okay with removing fileToBeIgnored from the SVN repository and adding it to its directory's svn:ignore property.

My problem is, if I do that, when other users do their next update, their SVN client will try to remove their local copy of fileToBeIgnored. I don't want that; instead, I would like for everyone's currently existing local copy to be preserved.

I开发者_Go百科s there a way to remove a file from the SVN repository without it being removed from a user's local copy on subsequent update?


Do the commit with the delete and the property change; then there are two scenarios:

  1. Another dev has no local changes. He updates, and his file is deleted. He can just svn cat the appropriate revision of the file to his working copy again.

  2. Another dev has local changes. When he updates, he gets a tree conflict. He can svn resolve --accept=working fileToBeIgnored to resolve the conflict, then svn rm --keep-local fileToBeIgnored to avoid adding the file to version control again, while keeping his local copy.


Is there a way to remove a file from the SVN repository without it being removed from a user's local copy on subsequent update?

I don't think so.

What I would do is to send a mail to everyone notifying them of the change. Whoever doesn't manage to keep a copy on the side can always get an earlier version of the file from the repository.


Move the file to a different folder.
Remove from SVN.
Update.
Add the file back to the folder.
Commit with svn:ignore.

0

精彩评论

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