Get the latter using the TFS API

I am trying to use the TFS API to retrieve the latest code from a server in a workspace. I found this question:

How to get the latest source code using Team Foundation Server SDK?

This, in essence, is what I want to do; however, I want to use an existing workspace and get only a specific section of code. Is it possible?

For example (using the example indicated in the above question):

workspace.Get(request, GetOptions.GetAll | GetOptions.Overwrite, "$/MyFolder/MyProject"); 

Is this possible if you do not set up a new workspace or something else?

+4
source share
1 answer

You need to access your workspace using something like this:

 var vcServer = teamProjectCollection.GetService<VersionControlServer>(); Workspace myWorkspace = vcServer.GetWorkspace("workspaceName", "workspaceOwner"); 

Then you will get the latest version with

  myWorkspace.Get(); 

or specify what you want to get by consulting this .

To find out about your jobs, go to VS on

File> Source Control> Workspaces ...

+5
source

Source: https://habr.com/ru/post/1384104/


All Articles