安全删除TFS分支项目
我目前正在为大量解决方案重组我们的 TFS 源代码控制,到目前为止我已经成功完成了这项工作。
我目前遇到一个问题,我需要删除旧的“发布分支”TFS 项目,该项目是针对旧结构进行分支的,并且不再需要,因为我现在在新结构中托管发布分支。
这是移动所有内容后源代码管理现在的外观示例:
$/Source Project
/Trunk
/[Projects]
/Release
/[Projects]
$/Release Branch Project
/[Projects]
/[Other legacy stuff]
到目前为止,我发现的信息如下:
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:
tf delete /lock:checkout /recursive TestMain
to delete a branch.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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
让我这样陈述事实:
Let me put the facts like this:
在 TFS 中,您通常无法永久删除团队项目中的任何内容(并且
TfsDeleteProject
会删除整个团队项目,但尚不清楚源代码管理内容是否会真正被删除,因为团队项目只是顶部项目)源控制树的级别)。删除一个文件或整个文件集只是另一个跟踪更改,返回历史记录仍然可以看到它。
您可以使用权限使其无法被所有人访问。或者在“过时”团队项目下重命名。
编辑(我终于记得这个命令在哪里了):
还有另一个选项,从命令行:
tf destroy
:我希望这会删除分支记录以创建现已销毁的文件......但您可能需要检查。
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
:I would expect this to remove the branch records to create the, now destroyed, files... but you might need to check.
选择要取消分支的分支文件夹。然后
文件>源代码控制>分支和合并>转换到文件夹
。Select the branch folder you want to unbranch. then
File > Source Control > Branching and Merging > Convert to Folder
.在 VS2013 中,我在 @Radhika 答案下找不到它,但
我确实在 Team Explorer > 下找到了它。源代码管理资源管理器>右键
项目>分支和合并>转换到文件夹
希望这可以节省您的时间。
编辑从@DdW的评论中复制:转换后,在启用删除选项之前,您需要执行
获取最新版本
In
VS2013
I couldn't find it under @Radhika answerI did find it under
Team Explorer > Source Control Explorer >
right mouseon project > Branching and Merging > Convert to folder
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使用回滚删除分支
设置。
选择 1。
REMOVE A BRANCH USING ROLLBACK
set.
Choose 1.