SVN:如何自动删除工作副本但保留忽略的项目?
我目前有一个工作副本,其中有两个分支:
/Source
/Source/v1.2
/Source/v1.3
我想删除它,而只签出我需要的分支(即,在目录树中向下一层,只签出 /Source/v1.3)。然而,v1.3 的工作副本包含一堆我实际上想保留的被忽略的文件。所以我不想删除整个工作副本并重新开始。当然,我不想手动尝试找到所有被忽略的文件并保留它们。有什么命令可以做到这一点吗?
我在 Windows 上使用 TortoiseSVN 和 Slik SVN 进行自动化构建。
I currently have a Working Copy with two branches in it:
/Source
/Source/v1.2
/Source/v1.3
I want to delete this and instead only check out the branch I need (i.e. go one level down the directory tree and only check out /Source/v1.3). However the working copy of v1.3 contains a bunch of ignored files that I actually want to keep. So I don't want to just delete the whole working copy and start over. And of course I don't want to manually try to locate all of the ignored files and preserve them. Is there any sort of command to do this?
I'm on Windows using TortoiseSVN as well as Slik SVN for automated builds.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Subversion 中的每个子目录树都是其自己的工作目录。它包含将其用作工作目录所需的一切。这包括被忽略的目录和文件、修订历史记录等。
您没有理由不能简单地使用所需的子目录作为新的工作目录并删除其余目录。事实上,一旦您将顶部子目录树移开,您甚至可以对其进行重命名。在此示例中,您将 v1.3 目录移动到 C:\ 驱动器并将其重命名为 \Source-v1.3。然后,删除其余部分:
这将保留您忽略的所有文件和目录。
Each sub-directory tree in Subversion is its own working directory. It contains everything you need in order to use it as a working directory. This includes the directories and files that are being ignored, revision history, etc.
There is no reason why you can't simply use the sub-directory you want as your new working directory and delete the rest. In fact, you can even rename the top sub-directory tree once you get it out of the way. In this example, you're moving the v1.3 directory to the C:\ drive and renaming it \Source-v1.3. Then, deleting the rest:
This will keep all of the files and directories you've ignored, ignored.