移动文件丢失了TFS 2013中的历史记录 [英] Moving files lose history in TFS 2013

查看:117
本文介绍了移动文件丢失了TFS 2013中的历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将VS2013 Update 4与TFS 2013 Update 4一起使用.在Source Control Explorer中,每当我将文件从一个文件夹移动到另一个文件夹时,我都可以看到文件的历史记录保留在新位置.但是,当我签入未决的更改时,该历史记录已消失.当我尝试运行"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一个在重命名后签入的新更改

如果在Source Control Explorer(或从Source Control Explorer的较旧版本(例如VS 2008))之外或在Solution Explorer之外进行重命名,则更改将被检测为两个单独的动作,一个是删除和一个添加.您可以使用待更改"窗口将其升级为重命名,以便保留历史记录:

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重命名"和"tf移动"来完成.使用标准的"mv"和"ren"命令将无法保存历史记录.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆