更新时间:2025-08-20 GMT+08:00
分享

查看仓库继承设置

功能介绍

查看仓库继承设置

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v4/repositories/{repository_id}/inherit-setting

表1 路径参数

参数

是否必选

参数类型

描述

repository_id

Integer

参数解释:

仓库的ID,通过查询用户所有仓库接口查询项目列表获取。

约束限制:

不涉及。

取值范围:

1-2147483647

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

参数解释:

用户Token。 通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。

约束限制:

必传。

取值范围:

字符串长度不少于1,不超过10万。

默认取值:

不涉及。

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

[数组元素]

Array of RepositoryInheritSettingDto objects

仓库继承设置列表

表4 RepositoryInheritSettingDto

参数

参数类型

描述

name

String

参数解释:

设置源类型。

取值范围:

  • protected_branches,保护分支设置。

  • protected_tags,保护Tag设置。

  • repository_settings,仓库设置。

  • push_rules,提交规则设置。

  • merge_requests,合并请求设置。

  • e2e_settings,E2E设置。

  • watermark,水印设置。

枚举值:

  • protected_branches

  • protected_tags

  • repository_settings

  • push_rules

  • merge_requests

  • e2e_settings

  • watermark

inherit_mod

String

参数解释:

继承设置。

取值范围:

  • inherit,继承上级配置。

  • custom,使用当前仓库配置。

  • force_inherit,强制继承上级配置。

枚举值:

  • inherit

  • custom

  • force_inherit

请求示例

响应示例

状态码:200

仓库继承设置列表

[ {
  "name" : "protected_branches",
  "inherit_mod" : "custom"
}, {
  "name" : "protected_tags",
  "inherit_mod" : "custom"
}, {
  "name" : "repository_settings",
  "inherit_mod" : "inherit"
}, {
  "name" : "push_rules",
  "inherit_mod" : "inherit"
}, {
  "name" : "merge_requests",
  "inherit_mod" : "inherit"
}, {
  "name" : "e2e_settings",
  "inherit_mod" : "inherit"
}, {
  "name" : "watermark",
  "inherit_mod" : "inherit"
} ]

状态码

状态码

描述

200

仓库继承设置列表

错误码

请参见错误码

相关文档