【问题标题】:TFSAPI: Get previous version of a particular fileTFSAPI:获取特定文件的先前版本
【发布时间】:2020-09-23 04:07:51
【问题描述】:

我有一个程序可以检索与特定变更集关联的文件。我需要将此文件与其以前的版本进行比较。我需要为此下载文件的先前版本。有人可以帮忙吗?
还感谢特定的文档/链接。

【问题讨论】:

标签: tfs tfs-sdk changeset


【解决方案1】:

您可以参考这些 API 调用:

您可以在 Repos Files 中比较文件的两个不同版本:

然后点击历史记录选择以前的版本:

如下图,下载之前版本的文件。

如果你想用rest api下载文件,可以参考Items - Get

GET https://{instance}/{collection}/{project}/_apis/git/repositories/{repositoryId}/items?path={path}&scopePath={scopePath}&recursionLevel={recursionLevel}&includeContentMetadata={includeContentMetadata}&latestProcessedChange={latestProcessedChange}&download={download}&$format={$format}&versionDescriptor.versionOptions={versionDescriptor.versionOptions}&versionDescriptor.version={versionDescriptor.version}&versionDescriptor.versionType={versionDescriptor.versionType}&includeContent={includeContent}&resolveLfs={resolveLfs}&api-version=5.0

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-12-10
    • 2014-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多