I have a program which can retrieve the files associated with a particular changeset. I need to compare this file to its previous version. I need to download the previous version of the file for this. Can someone help out with this?
Specific documentation/links are also appreciated.
You can refer to these API calls :
You can compare two different versions of a file in Repos Files:
Then click in History to select a previous version:
As shown below, download the previous version of the file.
If you want to download files with rest api , you can refer to 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