I was trying to download the entire code/files from a particular commit, which is present in a branch, which is inside a repository.
I was trying to use gitClient.GetItemZipAsync, but getting an error like
One or more errors occurred.
(TF401174: The item 'http://path/projectName/_git/Repositoryname/commit/commitId'
could not be found in the repository 'RepositoryName' at the version specified by ''
(resolved to commit 'commitId'))
. I have repository id, but I needed the files from a commit id that is inside a branch.
Used the below code
foreach (var commit in commits) { GitVersionDescriptor gitVer = new GitVersionDescriptor() { VersionType = GitVersionType.Commit, VersionOptions = GitVersionOptions.None, Version = commit.CommitId }; Stream s = gitClient.GetItemZipAsync(projectId, repo.Id, commit.RemoteUrl,null, recursionLevel: VersionControlRecursionType.None, includeContentMetadata: false, latestProcessedChange: false, download: false, versionDescriptor: gitVer).Result;
I was trying to download the entire code/files from a particular commit, which is present in a branch, which is inside a repository. I was trying to use gitClient.GetItemZipAsync, but getting an error like One or more errors occurred. (TF401174: The item 'http://path/projectName/_git/Repositoryname/commit/commitId' could not be found in the repository 'RepositoryName' at the version specified by ''
(resolved to commit 'commitId'))
. I have repository id, but I needed the files from a commit id that is inside a branch.
Used the below code
foreach (var commit in commits) { GitVersionDescriptor gitVer = new GitVersionDescriptor() { VersionType = GitVersionType.Commit, VersionOptions = GitVersionOptions.None, Version = commit.CommitId }; Stream s = gitClient.GetItemZipAsync(projectId, repo.Id, commit.RemoteUrl,null, recursionLevel: VersionControlRecursionType.None, includeContentMetadata: false, latestProcessedChange: false, download: false, versionDescriptor: gitVer).Result;
Thanks