Getting a list of Git repositories programmatically using the REST API
In this recipe, you'll learn how to get a list of Git repositories in a Team Project programmatically using the GitHttpClient
REST API.
Getting ready
Refer to instructions in the Getting ready section of the Getting build details programmatically using the REST API recipe for setup details. Download the RESTDemo
solution provided with the course material. In this recipe, we'll be going through the GetGitRepos
project to get a list of Git repositories with details from a Team Project.
How to do it…
In the
RESTDemo
solution, setGetGitRepos
as the startup project:Run the
GetGitRepos
project, this will launch a console. Enter the TFS Server URL and press Enter:Enter the username and password of the user you want to connect to the TFS with and press Enter:
Enter the project name you would like to retrieve the build details from:
The console outputs the list of Git repositories in FabrikamGit project along with the details of the...