Partager via


Git API

TFS 2017 | TFS 2015 | TFS 2013

Note

Looking for REST APIS that support TFS 2018 or later versions? See the Azure DevOps REST API Reference.

api-version = 1.0

Use these APIs to work with Git repositories in VSTS/TFS. Repositories contain objects representing core Git concepts:

  • blobs (files)
  • trees (folders)
  • commits
  • refs (branches, lightweight tags)

and other resources that represent the history of those items or act on their state.

There are code samples available for this area.

Note

Repositories have both a name and an identifier. Identifiers are globally unique, but several projects may contain a repository of the same name. You don't need to include the project if you specify a repository by ID. However, if you specify a repository by name, you must also specify the project (by name or ID).

Common tasks

Areas Common Tasks
Git Repositories
Pull Requests
Commits
Refs (branches and tags)
Pushes
Items (Files)

All Git API areas

In case you're looking for something not found in the Common tasks section above, below is a list of all areas of the Git API.

Note

For more information on Git, see Use Git with Visual Studio and Team Foundation Server.