Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list all the files that are in TFS GIT repo using REST API

All, I am trying to get the list of all the files that are in a particular repo in TFS GIT using REST API. I found the below one but it only display the contents of the specific file name mentioned after "scopePath=/buld.xml", it only display the contents of file build.xml.

But I am trying, only to list all the files that are in a particular repository with out mentioning the particular file name.

Please help me.

https://{accountName}.visualstudio.com/{project}/_apis/git/repositories/{repositoryId}/items?items?scopePath=/&api-version=4.1

like image 655
user9473385 Avatar asked Jun 11 '18 19:06

user9473385


People also ask

Does TFS have an API?

The Team Foundation Server APIs are based on REST, JSON and service hooks - all standard web technologies broadly supported in the industry. The REST APIs documented here are for older versions of the APIs (TFS 2015 up to TFS 2018 Update 1).

How do I access Azure DevOps API?

To access Azure DevOps API's, first, we need to authenticate against the Azure DevOps organization. There are several ways to authenticate to Azure DevOps, using Azure Active Directory, OAuth or using a Personal Access Token. You need to choose Authentication mechanism depends on your business scenarios.

How do I pull a repository from Azure DevOps?

From your web browser, open the team project for your Azure DevOps organization, and then choose Repos > Files to open the Files view. In the Files view, choose Clone to launch the Clone Repository popup. Copy the clone URL from the Clone Repository popup.


1 Answers

You can use the api below:

https://{accountName}.visualstudio.com/{project}/_apis/git/repositories/{repositoryId}/items?recursionLevel=Full&api-version=4.1

enter image description here

like image 64
Cece Dong - MSFT Avatar answered Sep 30 '22 01:09

Cece Dong - MSFT