从 TFS 获取最新信息时的时间戳,这有关系吗? [英] timestamp when Getting Latest from TFS and does it matter?

查看:33
本文介绍了从 TFS 获取最新信息时的时间戳,这有关系吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道为什么我以前从未注意到这一点,但是当我从 TFS 获取最新"时,我本地工作文件夹中文件的日期和时间设置为当前日期和时间.这适用于创建和修改日期,即使没有进行任何更改(就像我刚刚做了获取最新"一样,仅此而已).

I'm not sure why I never noticed this before but when I "Get Latest" from TFS, the date and time on the files in my local working folder are set to the current date and time. This applies to the Created and Modified dates, even if no changes have been made (as I just did "Get Latest", nothing more).

我是否应该担心文件的日期和时间不能反映文件创建和随后修改的真实日期和时间?我在 TFS 中有修订历史,所以我并不过分担心,但我必须承认这感觉不对.技术上一切正常,但我想知道发生了什么.

Should I be concerned about the dates and times of the files not reflecting the true date and time the file was created and subsequently modified? I have the revision history in TFS so I'm not overly concerned but I gotta admit this feels wrong. Everything technically works but I want to know what's going on.

推荐答案

如您所见,Team Foundation Server 中的默认行为是将文件时间写入当前"时间(当您检索文件时).这是大多数版本控制工具的默认行为,通常被认为是安全的.

As you note, the default behavior in Team Foundation Server is to write file times to the "current" time (when you retrieved the file.) This is the default behavior of most version control tools and generally considered safe.

将时间设置为远程时间在许多情况下可能会产生负面影响.例如,make 将扫描比上次构建时间更新的文件.将文件时间设置为服务器的时间会影响确定自上次构建以来哪些文件已更改的能力.

Setting time to the remote time can have negative consequences in many scenarios. For example, make will scan for files newer than the last build time. Setting file times to the server's time can impact the ability to determine which files have changed since the last build.

但是,如果您确实更喜欢这种行为并且至少使用 TFS 2012 和 Visual Studio 2012,则可以通过将文件时间"设置为签入"来针对每个工作区启用它:

However, if you do prefer this behavior and are using at least TFS 2012 and Visual Studio 2012, you can enable it on a per-Workspace basis by setting "File Time" to "Checkin":

其他详细信息 来自微软:

文件时间:

  • 如果您希望每个文件的日期和时间戳与您的版本的变更集的时间戳大致匹配,请选择 Checkin工作区.一些问题和例外是:

  • Choose Checkin if you want the date and time stamp of each file to generally match the stamp of the changeset of the version in your workspace. A few issues and exceptions are:

  • 当您修改本地文件时,日期和时间戳将与您修改文件时的日期和时间一致.

  • When you modify the local file, the date and time stamp will match the date and time when you modified the file.

此功能仅在您使用 Visual Studio 2012 或更高版本以及 Visual Studio Team Foundation Server 2012 或更高版本时可用.

This feature is available only if you are using Visual Studio 2012 or later and Visual Studio Team Foundation Server 2012 or later.

该设置不适用于文件夹,除非该文件夹包含的文件存在待处理的添加或删除操作.

The setting does not apply to folders, unless there is a pending add or delete operation to a file contained by the folder.

您可能无法逐步构建代码项目.相反,您将不得不重建).

You might not be able to build your code project incrementally. Instead, you will have to rebuild).

如果您希望日期和时间戳与您上次修改本地文件的日期和时间相匹配,请选择 当前.例如,一个团队成员在周一签入了对文件的最新更改.在星期二,您执行 get 操作来更新文件.日期和时间戳设置为星期二.

Choose Current if you want the date and time stamp to match the date and time when you last modified the local file. For example, a team member checked in the latest change to the file on Monday. On Tuesday, you perform a get operation to update the file. The date and time stamp is set to Tuesday.

这篇关于从 TFS 获取最新信息时的时间戳,这有关系吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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