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.
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.
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":
Additional details from Microsoft:
File Time:
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.
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).
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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…