Sascha
Sascha

Reputation: 2213

Howto query TFS 2013 API for git repositories in a TeamProjectCollection?

Does anybody know how to get all git repositories within an TFS 2013 TeamProjectCollection? Documentation is very poor for git related stuff.

Upvotes: 3

Views: 2636

Answers (2)

Lee Richardson
Lee Richardson

Reputation: 8837

The Web API's are apparently the correct (and better documented) approach. e.g.

GET http://mytfsserver:8080/tfs/defaultcollection/_apis/git/repositories 

See: http://www.visualstudio.com/integrate/reference/reference-vso-git-repositories-vsi

Upvotes: 1

allen
allen

Reputation: 4647

Have you tried looking at Microsoft.TeamFoundation.Git.Client?

Some pseudo code

GitHttpClient client = new GitHttpClient("collectionurl", creds)
var gitRepos = client.GetRepositoriesAsync().Result

Upvotes: 2

Related Questions