Commits - Get Changes

特定のコミットの変更を取得します。

GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/changes?api-version=5.0
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/commits/{commitId}/changes?top={top}&skip={skip}&api-version=5.0

URI パラメーター

Name / 必須 型 説明
commitId
path True

string

コミットの ID。

organization
path True

string

Azure DevOps 組織の名前です。

repositoryId
path True

string

リポジトリの ID またはフレンドリ名。 フレンドリ名を使用するには、projectId も指定する必要があります。

project
path

string

プロジェクト ID またはプロジェクト名

api-version
query True

string

使う API のバージョン。 このバージョンの API を使用するには、これを '5.0' に設定する必要があります。

skip
query

integer (int32)

スキップする変更の数。

top
query

integer (int32)

返される変更の最大数。

応答

Name 型 説明
200 OK

GitCommitChanges

正常な操作

セキュリティ

oauth2

型: oauth2
フロー: accessCode
Authorization URL (承認 URL): https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL (トークン URL): https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

スコープ

Name 説明
vso.code コミット、変更セット、ブランチ、およびその他のバージョン管理成果物に関するソース コードとメタデータを読み取る機能を付与します。 また、コードを検索し、サービス フックを使用してバージョン管理イベントに関する通知を受け取る機能も付与されます。

例

With changes

要求のサンプル

GET https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/commits/be67f8871a4d2c75f13a51c1d3c30ac0d74d4ef4/changes?top=2&skip=10&api-version=5.0

応答のサンプル

{
  "changeCounts": {
    "Add": 456
  },
  "changes": [
    {
      "item": {
        "gitObjectType": "blob",
        "path": "/MyWebSite/MyWebSite/favicon.ico",
        "url": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/items/MyWebSite/MyWebSite/favicon.ico?versionType=Commit"
      },
      "changeType": "add"
    },
    {
      "item": {
        "gitObjectType": "tree",
        "path": "/MyWebSite/MyWebSite/fonts",
        "isFolder": true,
        "url": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/items/MyWebSite/MyWebSite/fonts?versionType=Commit"
      },
      "changeType": "add"
    }
  ]
}

定義

Name 説明
ChangeCountDictionary
GitChange
GitCommitChanges
GitTemplate
ItemContent
ItemContentType
VersionControlChangeType

アイテムに対して行われた変更の種類。

ChangeCountDictionary

GitChange

Name 型 説明
changeId

integer

変更のグループ内の変更の ID。

changeType

VersionControlChangeType

アイテムに対して行われた変更の種類。

item

string

現在のバージョン。

newContent

ItemContent

変更後のアイテムの内容。

newContentTemplate

GitTemplate

新しい変更をプッシュするときに使用する新しいコンテンツ テンプレート。

originalPath

string

現在のパスと異なる場合は、アイテムの元のパス。

sourceServerItem

string

サーバー上の項目のパス。

url

string

アイテムを取得する URL。

GitCommitChanges

Name 型 説明
changeCounts

ChangeCountDictionary

changes

GitChange[]

GitTemplate

Name 型 説明
name

string

テンプレートの名前

type

string

テンプレートの種類

ItemContent

Name 型 説明
content

string

contentType

ItemContentType

ItemContentType

値 説明
rawText
base64Encoded

VersionControlChangeType

アイテムに対して行われた変更の種類。

値 説明
none
add
edit
encoding
rename
delete
undelete
branch
merge
lock
rollback
sourceRename
targetRename
property
all