Pushes - Get
检索特定推送。
GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}?api-version=5.0
			GET https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pushes/{pushId}?includeCommits={includeCommits}&includeRefUpdates={includeRefUpdates}&api-version=5.0
			URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 | 
|---|---|---|---|---|
| 
						 organization 
					 | 
					path | True | 
			 string  | 
					
						 Azure DevOps 组织的名称。  | 
				
| 
						 push 
					 | 
					path | True | 
			 integer int32 | 
					
						 推送的 ID。  | 
				
| 
						 repository 
					 | 
					path | True | 
			 string  | 
					
						 存储库的名称或 ID。  | 
				
| 
						 project 
					 | 
					path | 
			 string  | 
					
						 项目 ID 或项目名称  | 
				|
| 
						 api-version 
					 | 
					query | True | 
			 string  | 
					
						 要使用的 API 版本。 应将其设置为“5.0”才能使用此版本的 API。  | 
				
| 
						 include 
					 | 
					query | 
			 integer int32 | 
					
						 要包含在结果中的提交数。  | 
				|
| 
						 include 
					 | 
					query | 
			 boolean  | 
					
						 如果为 true,则包含通过推送更新的引用列表。  | 
				
响应
| 名称 | 类型 | 说明 | 
|---|---|---|
| 200 OK | 
		 成功的操作  | 
安全性
oauth2
					类型: 
					oauth2
					流向: 
					accessCode
					授权 URL: 
					https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
					令牌 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
			
作用域
| 名称 | 说明 | 
|---|---|
| vso.code | 授予读取有关提交、更改集、分支和其他版本控制项目的源代码和元数据的能力。 此外,还允许通过服务挂钩搜索代码并获取有关版本控制事件的通知。 | 
示例
Just the push
示例请求
GET https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/23?api-version=5.0
示例响应
{
  "commits": [],
  "pushedBy": {
    "id": "d6245f20-2af8-44f4-9451-8107cb2767db",
    "displayName": "Normal Paulk",
    "uniqueName": "fabrikamfiber16@hotmail.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=d6245f20-2af8-44f4-9451-8107cb2767db"
  },
  "pushId": 23,
  "date": "2014-06-30T18:11:18.0929091Z",
  "url": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/23",
  "_links": {
    "self": {
      "href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/23"
    },
    "repository": {
      "href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249"
    },
    "commits": {
      "href": "https://dev.azure.com/fabrikam/_apis/git/repositories/278d5cd2-584d-4b63-824a-2ba458937249/pushes/23/commits"
    },
    "pusher": {
      "href": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/d6245f20-2af8-44f4-9451-8107cb2767db"
    }
  }
}
				定义
| 名称 | 说明 | 
|---|---|
| 
							Change | 
						|
| 
							Git | 
						|
| 
							Git | 
						
							 提供描述 Git 提交和关联元数据的属性。  | 
					
| 
							Git | 
						|
| 
							Git | 
						|
| 
							Git | 
						|
| 
							Git | 
						|
| 
							Git | 
						|
| 
							Git | 
						
							 此类包含发布状态的服务/扩展的元数据。  | 
					
| 
							Git | 
						
							 唯一标识状态的状态上下文。  | 
					
| 
							Git | 
						
							 状态的状态。  | 
					
| 
							Git | 
						|
| 
							Git | 
						
							 Git 操作的用户信息和日期。  | 
					
| 
							Identity | 
						|
| 
							Item | 
						|
| 
							Item | 
						|
| 
							Project | 
						
							 项目状态。  | 
					
| 
							Project | 
						
							 项目可见性。  | 
					
| 
							Reference | 
						
							 表示 REST 引用链接集合的类。  | 
					
| 
							Resource | 
						|
| 
							Team | 
						
							 TeamProjectCollection 的引用对象。  | 
					
| 
							Team | 
						
							 表示对 TeamProject 的浅表引用。  | 
					
| 
							Version | 
						
							 对项所做的更改的类型。  | 
					
ChangeCountDictionary  
			
			
			GitChange 
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| changeId | 
			 integer  | 
	
		 更改组中更改的 ID。  | 
| changeType | 
		 对项所做的更改的类型。  | 
|
| item | 
			 string  | 
	
		 当前版本。  | 
| newContent | 
		 更改后项的内容。  | 
|
| newContentTemplate | 
		 推送新更改时要使用的新内容模板。  | 
|
| originalPath | 
			 string  | 
	
		 项的原始路径(如果不同于当前路径)。  | 
| sourceServerItem | 
			 string  | 
	
		 服务器上的项的路径。  | 
| url | 
			 string  | 
	
		 用于检索项的 URL。  | 
GitCommitRef  
			
			提供描述 Git 提交和关联元数据的属性。
| 名称 | 类型 | 说明 | 
|---|---|---|
| _links | 
		 相关 REST 引用链接的集合。  | 
|
| author | 
		 提交的作者。  | 
|
| changeCounts | 
		 提交中包含的更改类型 (编辑、删除等) 计数。  | 
|
| changes | 
		 提交中包含的更改的枚举。  | 
|
| comment | 
			 string  | 
	
		 提交注释或消息。  | 
| commentTruncated | 
			 boolean  | 
	
		 指示注释是否从完整的 Git 提交注释消息中截断。  | 
| commitId | 
			 string  | 
	
		 提交的 ID (SHA-1) 。  | 
| committer | 
		 提交的提交者。  | 
|
| parents | 
			 string[]  | 
	
		 此提交的父提交 ID 的枚举。  | 
| push | 
		 与此提交关联的推送。  | 
|
| remoteUrl | 
			 string  | 
	
		 提交的远程 URL 路径。  | 
| statuses | 
		 来自服务和扩展的状态元数据的列表,这些元数据可能会将其他信息关联到提交。  | 
|
| url | 
			 string  | 
	
		 此资源的 REST URL。  | 
| workItems | 
		 与此提交关联的工作项列表。  | 
GitPush 
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| _links | 
		 表示 REST 引用链接集合的类。  | 
|
| commits | 
		 提供描述 Git 提交和关联元数据的属性。  | 
|
| date | 
			 string  | 
	|
| pushId | 
			 integer  | 
	|
| pushedBy | ||
| refUpdates | ||
| repository | ||
| url | 
			 string  | 
	
GitPushRef  
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| _links | 
		 表示 REST 引用链接集合的类。  | 
|
| date | 
			 string  | 
	|
| pushId | 
			 integer  | 
	|
| pushedBy | ||
| url | 
			 string  | 
	
GitRefUpdate  
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| isLocked | 
			 boolean  | 
	|
| name | 
			 string  | 
	|
| newObjectId | 
			 string  | 
	|
| oldObjectId | 
			 string  | 
	|
| repositoryId | 
			 string  | 
	
GitRepository 
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| _links | 
		 表示 REST 引用链接集合的类。  | 
|
| defaultBranch | 
			 string  | 
	|
| id | 
			 string  | 
	|
| isFork | 
			 boolean  | 
	
		 如此 如果存储库是作为分支创建的  | 
| name | 
			 string  | 
	|
| parentRepository | ||
| project | 
		 表示对 TeamProject 的浅表引用。  | 
|
| remoteUrl | 
			 string  | 
	|
| size | 
			 integer  | 
	
		 存储库的压缩大小 (字节) 。  | 
| sshUrl | 
			 string  | 
	|
| url | 
			 string  | 
	|
| validRemoteUrls | 
			 string[]  | 
	
GitRepositoryRef  
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| collection | 
		 此分支所在的团队项目集合  | 
|
| id | 
			 string  | 
	|
| isFork | 
			 boolean  | 
	
		 如此 如果存储库是作为分支创建的  | 
| name | 
			 string  | 
	|
| project | 
		 表示对 TeamProject 的浅表引用。  | 
|
| remoteUrl | 
			 string  | 
	|
| sshUrl | 
			 string  | 
	|
| url | 
			 string  | 
	
GitStatus 
			
			此类包含发布状态的服务/扩展的元数据。
| 名称 | 类型 | 说明 | 
|---|---|---|
| _links | 
		 参考链接。  | 
|
| context | 
		 状态的上下文。  | 
|
| createdBy | 
		 创建状态的标识。  | 
|
| creationDate | 
			 string  | 
	
		 状态的创建日期和时间。  | 
| description | 
			 string  | 
	
		 状态说明。 通常描述状态的当前状态。  | 
| id | 
			 integer  | 
	
		 状态标识符。  | 
| state | 
		 状态的状态。  | 
|
| targetUrl | 
			 string  | 
	
		 包含状态详细信息的 URL。  | 
| updatedDate | 
			 string  | 
	
		 状态的上次更新日期和时间。  | 
GitStatusContext  
			
			唯一标识状态的状态上下文。
| 名称 | 类型 | 说明 | 
|---|---|---|
| genre | 
			 string  | 
	
		 状态的流派。 生成状态的服务/工具的名称通常可以为空。  | 
| name | 
			 string  | 
	
		 状态的名称标识符不能为 null 或空。  | 
GitStatusState  
			
			状态的状态。
| 值 | 说明 | 
|---|---|
| error | 
		 出现错误的状态。  | 
| failed | 
		 状态失败。  | 
| notApplicable | 
		 状态不适用于目标对象。  | 
| notSet | 
		 状态状态未设置。 默认状态。  | 
| pending | 
		 状态挂起。  | 
| succeeded | 
		 状态成功。  | 
GitTemplate 
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| name | 
			 string  | 
	
		 模板的名称  | 
| type | 
			 string  | 
	
		 模板的类型  | 
GitUserDate  
			
			Git 操作的用户信息和日期。
| 名称 | 类型 | 说明 | 
|---|---|---|
| date | 
			 string  | 
	
		 Git 操作的日期。  | 
| 
			 string  | 
	
		 Email执行 Git 操作的用户的地址。  | 
|
| imageUrl | 
			 string  | 
	
		 用户头像的 URL。  | 
| name | 
			 string  | 
	
		 执行 Git 操作的用户的名称。  | 
IdentityRef 
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| _links | 
		 此字段包含零个或多个有关图形主题的有趣链接。 可以调用这些链接来获取有关此图主题的其他关系或更详细的信息。  | 
|
| descriptor | 
			 string  | 
	
		 描述符是在系统运行时引用图形主题的主要方法。 此字段将唯一标识帐户和组织中的同一图形主题。  | 
| directoryAlias | 
			 string  | 
	|
| displayName | 
			 string  | 
	
		 这是图形主题的非唯一显示名称。 若要更改此字段,必须在源提供程序中更改其值。  | 
| id | 
			 string  | 
	|
| imageUrl | 
			 string  | 
	|
| inactive | 
			 boolean  | 
	|
| isAadIdentity | 
			 boolean  | 
	|
| isContainer | 
			 boolean  | 
	|
| isDeletedInOrigin | 
			 boolean  | 
	|
| profileUrl | 
			 string  | 
	|
| uniqueName | 
			 string  | 
	|
| url | 
			 string  | 
	
		 此 URL 是指向此图主题的源资源的完整路由。  | 
ItemContent 
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| content | 
			 string  | 
	|
| contentType | 
ItemContentType  
			
			
				| 值 | 说明 | 
|---|---|
| base64Encoded | |
| rawText | 
ProjectState 
			
			项目状态。
| 值 | 说明 | 
|---|---|
| all | 
		 所有项目,不考虑状态。  | 
| createPending | 
		 项目已排队等待创建,但该过程尚未启动。  | 
| deleted | 
		 已删除项目。  | 
| deleting | 
		 正在删除 Project。  | 
| new | 
		 项目正在创建过程中。  | 
| unchanged | 
		 项目尚未更改。  | 
| wellFormed | 
		 项目已完全创建并可供使用。  | 
ProjectVisibility 
			
			项目可见性。
| 值 | 说明 | 
|---|---|
| private | 
		 项目仅对具有显式访问权限的用户可见。  | 
| public | 
		 项目对所有人都可见。  | 
ReferenceLinks 
			
			表示 REST 引用链接集合的类。
| 名称 | 类型 | 说明 | 
|---|---|---|
| links | 
			 object  | 
	
		 链接的只读视图。 由于引用链接是只读的,因此我们只想将其公开为只读。  | 
ResourceRef 
			
			
				| 名称 | 类型 | 说明 | 
|---|---|---|
| id | 
			 string  | 
	|
| url | 
			 string  | 
	
TeamProjectCollectionReference   
			
			TeamProjectCollection 的引用对象。
| 名称 | 类型 | 说明 | 
|---|---|---|
| id | 
			 string  | 
	
		 集合 ID。  | 
| name | 
			 string  | 
	
		 集合名称。  | 
| url | 
			 string  | 
	
		 集合 REST URL。  | 
TeamProjectReference  
			
			表示对 TeamProject 的浅表引用。
| 名称 | 类型 | 说明 | 
|---|---|---|
| abbreviation | 
			 string  | 
	
		 项目缩写。  | 
| defaultTeamImageUrl | 
			 string  | 
	
		 默认团队标识图像的 URL。  | 
| description | 
			 string  | 
	
		 如果有任何) ,项目说明 (。  | 
| id | 
			 string  | 
	
		 项目标识符。  | 
| name | 
			 string  | 
	
		 项目名称。  | 
| revision | 
			 integer  | 
	
		 项目修订。  | 
| state | 
		 项目状态。  | 
|
| url | 
			 string  | 
	
		 对象完整版本的 URL。  | 
| visibility | 
		 项目可见性。  | 
VersionControlChangeType   
			
			对项所做的更改的类型。
| 值 | 说明 | 
|---|---|
| add | |
| all | |
| branch | |
| delete | |
| edit | |
| encoding | |
| lock | |
| merge | |
| none | |
| property | |
| rename | |
| rollback | |
| sourceRename | |
| targetRename | |
| undelete |