安全删除TFS分支项目

发布于 2024-08-23 05:44:49 字数 975 浏览 1 评论 0原文

我目前正在为大量解决方案重组我们的 TFS 源代码控制,到目前为止我已经成功完成了这项工作。

我目前遇到一个问题,我需要删除旧的“发布分支”TFS 项目,该项目是针对旧结构进行分支的,并且不再需要,因为我现在在新结构中托管发布分支。

这是移动所有内容后源代码管理现在的外观示例:

$/Source Project
    /Trunk
        /[Projects]
    /Release
        /[Projects]

$/Release Branch Project
    /[Projects]
    /[Other legacy stuff]

到目前为止,我发现的信息如下:

  1. tf delete /lock:checkout /recursive TestMain 删除分支。
  2. TfsDeleteProject 用于删除项目

tf delete 似乎仅在我需要删除与主干位于同一项目内的分支时才相关,并且 TfsDeleteProject 似乎不会删除分支来自源项目的关联(我希望我是错的,见下文)。

有人可以告诉我上述操作是否有效,以及我应该按什么顺序执行它们,以成功删除 TFS $/Release Branch Project 同时删除分支关联(通过右键单击 >$/源项目 -> 属性 -> 分支)?

I'm currently reorganising our TFS source control for a very large set of solutions, and I've done this successfully so far.

I have a problem at the moment where I need to delete a legacy "Release Branch" TFS project that was branched for the old structure, and is no-longer required since I now host a release branch within the new structure.

This is an example of how the source control now looks after moving everything:

$/Source Project
    /Trunk
        /[Projects]
    /Release
        /[Projects]

$/Release Branch Project
    /[Projects]
    /[Other legacy stuff]

So far I've found information that says:

  1. tf delete /lock:checkout /recursive TestMain to delete a branch.
  2. TfsDeleteProject to delete a project

tf delete seems to be only relevant when I need to delete a branch that is within the same project as the trunk, and TfsDeleteProject doesn't seem like it will delete the branch association from the source project (I hope I'm wrong, see below).

Can someone tell me if the above will work, and in what order I should perform them in, to successfully delete the TFS $/Release Branch Project while also deleting the branch association (from right-click $/Source Project -> Properties -> Branches)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

花伊自在美 2024-08-30 05:44:49

让我这样陈述事实:

  • 在TFS源代码控制系统的上下文中,“删除”是一个纯粹的逻辑操作。您可以随时取消删除。随着时间的推移,您可以让多个已删除的项目占据同一路径,甚至可以同时占据同一路径。分支关系被保留。
  • TFS“销毁”是物理删除。为了维护数据库完整性,这意味着所有实体关系也被删除:变更集历史记录、挂起的变更记录、搁置的版本、合并历史记录,以及分支层次结构。此销毁功能是在 TFS 2008 中引入的。
  • 销毁是唯一允许更改合并历史记录表(从中确定分支关系)的操作。所有其他操作都严格限于附加操作。
  • TfsDeleteProject 尽力完全删除项目的所有痕迹,主要目标是允许创建具有相同名称的全新项目。一些TFS子系统支持物理删除;有些,例如 WIT 字段元数据,仅支持逻辑删除,即使在 TFS 2008 和 TFS 2008 中也是如此。超过。对于源代码控制,TfsDeleteProject 在 2005 年调用“delete”,在 2008 年以后调用“destroy”。

Let me put the facts like this:

  • Within the context of the TFS source control system, "Delete" is a purely logical operation. You can Undelete at any time. You can have multiple deleted items occupy the same path over time, or even simultaneously. Branch relationships are preserved.
  • TFS "Destroy" is physical removal. To maintain database integrity, that means all entity relationships are removed too: changeset history, pending change records, shelved versions, merge history, and yes -- branch hierarchy. This Destroy feature was introduced in TFS 2008.
  • Destroy is the only operation allowed to alter the merge history table (from which branch relationships are determined). All other operations are strictly append-only.
  • TfsDeleteProject does its best to completely remove all traces of a project, the primary goal being to allow creation of a brand new project with the same name. Some TFS subsystems support physical deletes; some, such as WIT field metadata, only support logical deletes, even in TFS 2008 & beyond. In the case of source control, TfsDeleteProject invokes "delete" in 2005 and "destroy" in 2008+.
旧人九事 2024-08-30 05:44:49

在 TFS 中,您通常无法永久删除团队项目中的任何内容(并且 TfsDeleteProject 会删除整个团队项目,但尚不清楚源代码管理内容是否会真正被删除,因为团队项目只是顶部项目)源控制树的级别)。

删除一个文件或整个文件集只是另一个跟踪更改,返回历史记录仍然可以看到它。

您可以使用权限使其无法被所有人访问。或者在“过时”团队项目下重命名。

编辑(我终于记得这个命令在哪里了):

还有另一个选项,从命令行:tf destroy

从 Team Foundation 版本控制中销毁或永久删除版本控制文件。

我希望这会删除分支记录以创建现已销毁的文件......但您可能需要检查。

In TFS you generally cannot permanently delete anything inside a team project (and TfsDeleteProject deletes a complete team project, but it is not clear if the source control content will actually be removed as a team project is just the top level of the source control tree).

A delete of a file, or whole set of files is just another tracked change, go back into history and it can still be seen.

You could use permissions to make it inaccessible to all. Or rename under an "Obsolete" team project.

EDIT (I finally remembered where this command was):

There is another option, from the command line: tf destroy:

Destroys, or permanently deletes, version-controlled files from Team Foundation version control.

I would expect this to remove the branch records to create the, now destroyed, files... but you might need to check.

忆梦 2024-08-30 05:44:49

选择要取消分支的分支文件夹。然后
文件>源代码控制>分支和合并>转换到文件夹

Select the branch folder you want to unbranch. then
File > Source Control > Branching and Merging > Convert to Folder.

在风中等你 2024-08-30 05:44:49

在 VS2013 中,我在 @Radhika 答案下找不到它,但

我确实在 Team Explorer > 下找到了它。源代码管理资源管理器>右键项目>分支和合并>转换到文件夹

在此处输入图像描述

希望这可以节省您的时间。

编辑从@DdW的评论中复制:转换后,在启用删除选项之前,您需要执行获取最新版本

In VS2013 I couldn't find it under @Radhika answer

I did find it under Team Explorer > Source Control Explorer >right mouse on project > Branching and Merging > Convert to folder

enter image description here

Hope this saves you time.

Edit Copied from comment by @DdW: you need to do a Get Latest Version after converting, before the Delete option will be enabled

櫻之舞 2024-08-30 05:44:49

使用回滚删除分支

  1. 右键单击​​所选分支。
  2. 选择回滚到特定变更集。
  3. 输入1

在此处输入图像描述设置。
选择 1。

  1. 该分支将被标记为删除。

输入图片此处描述

  1. 签入更改,它将从源代码管理中删除。

REMOVE A BRANCH USING ROLLBACK

  1. Right click on the select branch.
  2. Select rollback to specific changeset.
  3. Enter 1

enter image description hereset.
Choose 1.

  1. The branch will be marked for deletion.

enter image description here

  1. Check in the changes and it will be removed from source control.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文