Git API

Last Update: 7/14/2017

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.