次の方法で共有


Commits - Get Changes

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

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

URI パラメーター

名前 / 必須 説明
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 を使用するには、これを '7.1-preview.1' に設定する必要があります。

skip
query

integer

int32

スキップする変更の数。

top
query

integer

int32

返される変更の最大数。

応答

名前 説明
200 OK

GitCommitChanges

正常な操作

セキュリティ

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token 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

Scopes

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

With changes

Sample Request

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

Sample Response

{
  "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"
    }
  ]
}

定義

名前 説明
ChangeCountDictionary
GitChange
GitCommitChanges
GitTemplate
ItemContent
ItemContentType
VersionControlChangeType

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

ChangeCountDictionary

GitChange

名前 説明
changeId

integer

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

changeType

VersionControlChangeType

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

item

string

現在のバージョン。

newContent

ItemContent

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

newContentTemplate

GitTemplate

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

originalPath

string

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

sourceServerItem

string

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

url

string

アイテムを取得する URL。

GitCommitChanges

名前 説明
changeCounts

ChangeCountDictionary

changes

GitChange[]

GitTemplate

名前 説明
name

string

テンプレートの名前

type

string

テンプレートの種類

ItemContent

名前 説明
content

string

contentType

ItemContentType

ItemContentType

名前 説明
base64Encoded

string

rawText

string

VersionControlChangeType

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

名前 説明
add

string

all

string

branch

string

delete

string

edit

string

encoding

string

lock

string

merge

string

none

string

property

string

rename

string

rollback

string

sourceRename

string

targetRename

string

undelete

string