移动文件在 TFS 2013 中丢失历史记录

编程入门 行业动态 更新时间:2024-10-27 18:29:35
本文介绍了移动文件在 TFS 2013 中丢失历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 VS2013 Update 4 与 TFS 2013 Update 4 一起使用.在源代码管理资源管理器中,每当我将文件从一个文件夹移动到另一个文件夹时,我都可以看到该文件的历史记录保存在新位置.但是,当我签入待处理的更改时,该历史记录就消失了.当我尝试运行tf move"命令时会发生同样的事情.那么,如何在 TFS 中移动文件并保留文件的历史记录?

I'm using VS2013 Update 4 with TFS 2013 Update 4. In Source Control Explorer, whenever I move a file from one folder to another I can see that the file's history is preserved in the new location. However, that history is gone when I check-in the pending changes. The same thing happens when I try to run "tf move" command. So, how can you move a file in TFS and still keep the file's history?

推荐答案

当文件被正确重命名时,历史记录不会消失",而是与旧名称"相关联反而.以正确方式完成的重命名(作为重命名而不是作为删除+添加进行跟踪)有一个向下钻取选项来查看较旧的"文件.历史:

When a file is renamed correctly, the History is not "Gone", it's associated to the "old name" instead. A rename that is done the right way (tracked as a rename and not as an delete+add) has a drilldown option to view the "older" history:

变更集 81~82 包含对旧名称的更改变更集 83 包含删除 + 重命名变更集 84 重命名后签入的新变更

在源代码管理资源管理器之外(或从非常旧版本的源代码管理资源管理器(例如 VS 2008))或解决方案资源管理器之外完成重命名时,更改将被检测为两个单独的操作,一个删除和一个添加.您可以使用待定更改"将这些升级为重命名的窗口,以便保留历史记录:

When a rename is done outside of the Source Control Explorer (or from a very old version of the Source Control Explorer (e.g. VS 2008)) or outside the Solution Explorer, then the change will be detected as two individual actions, one delete and one add. You can use the "Pending Changes" window to promote these to a rename so that the history is preserved:

在命令行上,这只能使用tf rename"来完成.和tf移动".使用标准的mv"和仁"命令将无法保留历史记录.

On the commandline this can only be accomplished using "tf rename" and "tf move". Using the standard "mv" and "ren" commands will fail to preserve the history.

下面是使用所有不同方法的进一步示例,并通过查看当前文件名的历史记录清楚地表明历史记录被保留:

Below is a further example of using all the different methods and clearly showing that history is preserved by looking at the history of the current file name:

如评论中所述,历史记录存储在包含项目修订的团队项目中.在跨项目分支/移动时,您的历史将分布在这些项目中.如果您删除一个团队项目,那么该项目中积累的所有历史记录都将丢失.

As mentioned in the comments, history is stored in the Team Project that contains the items revision. When branching/moving across projects your history will be spread across these projects. Should you delete a Team project than all history that was accumulated in that project will be lost.

这篇关于移动文件在 TFS 2013 中丢失历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-28 20:01:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/738954.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:历史记录   文件   TFS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!