在IFS中复制源控制历史记录,然后在TFS中删除trunk

时间:2023-02-05 14:34:59

I have a TFS project that ought to be a folder under another project, so I want to move the source control history (We don't use the other features of TFS for this project, so I don't care about the project site). I've branched the code into the new location, and I'm preparing to delete the original project.

我有一个TFS项目应该是另一个项目下的文件夹,所以我想移动源代码控制历史记录(我们不使用TFS的其他功能来进行这个项目,所以我不关心项目站点) 。我已将代码分支到新位置,我正准备删除原始项目。

This SO question deals with the obviously lacking TFS feature of history after you branch, but since I'm deleting the trunk folder, this workaround functionality will break, and I'll completely lose my source history pre-branch.

这个SO问题处理分支后显然缺乏历史记录的TFS功能,但由于我正在删除trunk文件夹,此解决方法功能将中断,我将完全丢失我的源历史预分支。

Does anybody else have a better solution that would allow me to keep the history? I'd most like to retain the ability to do previous builds, and I lose that if I delete the trunk folder from source control, something which isn't acceptable. Thanks for your help!

有没有其他人有更好的解决方案,可以让我保持历史?我最想保留执行以前版本的能力,如果我从源代码管理中删除了trunk文件夹,那就输掉了,这是不可接受的。谢谢你的帮助!

2 个解决方案

#1


My recommendation is to use the Move (aka rename) feature. All history will be preserved in-place. And you can still recreate old builds in the other project by sync'ing back to the appropriate version.

我的建议是使用Move(aka rename)功能。所有历史将保留在原地。而且您仍然可以通过同步回适当的版本来重新创建其他项目中的旧版本。

If you do decide to Branch, it doesn't matter whether you delete the original source or not. Nothing in TFS is ever really deleted, simply placed into a "deleted state." History -- including merge history -- works identically. (Unless you also use the Destroy command. And even then, there's an option to delete the file contents & diffs but preserve the historical metadata.)

如果您决定分支,则删除原始来源无关紧要。 TFS中的任何内容都不会被真正删除,只需置于“已删除状态”即可。历史 - 包括合并历史 - 的工作方式相同。 (除非您也使用Destroy命令。即使这样,也可以选择删除文件内容和差异,但保留历史元数据。)

#2


Another option to consider besides deleting the directory is simply cloaking it. Cloaking the directory won't actually remove anything from source code control. It will just prevent it from being checked out on your client. The end effect is it won't show up on your client and you'll still have the work around for history purposes.

除了删除目录之外,另一个考虑的选择就是隐藏它。隐藏目录实际上不会从源代码控制中删除任何内容。它只会阻止它在您的客户端上签出。最终结果是它不会出现在您的客户端上,您仍然可以为历史目的进行处理。

#1


My recommendation is to use the Move (aka rename) feature. All history will be preserved in-place. And you can still recreate old builds in the other project by sync'ing back to the appropriate version.

我的建议是使用Move(aka rename)功能。所有历史将保留在原地。而且您仍然可以通过同步回适当的版本来重新创建其他项目中的旧版本。

If you do decide to Branch, it doesn't matter whether you delete the original source or not. Nothing in TFS is ever really deleted, simply placed into a "deleted state." History -- including merge history -- works identically. (Unless you also use the Destroy command. And even then, there's an option to delete the file contents & diffs but preserve the historical metadata.)

如果您决定分支,则删除原始来源无关紧要。 TFS中的任何内容都不会被真正删除,只需置于“已删除状态”即可。历史 - 包括合并历史 - 的工作方式相同。 (除非您也使用Destroy命令。即使这样,也可以选择删除文件内容和差异,但保留历史元数据。)

#2


Another option to consider besides deleting the directory is simply cloaking it. Cloaking the directory won't actually remove anything from source code control. It will just prevent it from being checked out on your client. The end effect is it won't show up on your client and you'll still have the work around for history purposes.

除了删除目录之外,另一个考虑的选择就是隐藏它。隐藏目录实际上不会从源代码控制中删除任何内容。它只会阻止它在您的客户端上签出。最终结果是它不会出现在您的客户端上,您仍然可以为历史目的进行处理。