获取项目分支列表
GET
/api/v1/{owner}/{repo}/branches.json最后修改时间: 1 年前
请求参数
Path 参数
owner
string
必需
repo
string
必需
Query 参数
keyword
string
搜索关键词
示例值:
master
page
string
页码
limit
string
每页个数
state
string
可选
全部 all 删除分支 deleted 默认为可展示分支
示例值:
deleted
示例代码
返回响应
成功(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
total_count
integer
必需
branches
array [object {16}]
必需
name
string
名称
commit
object
commit
protected
boolean
是否为保护分支
user_can_push
boolean
用户是否能push
user_can_merge
boolean
用户是否能合并
commit_id
string
commit标识
commit_time_from_now
string
提交时间距离现在
commit_time
string
提交时间
default_branch
string
默认分支
http_url
string
http下载地址
zip_url
string
zip下载地址
tar_url
string
tar下载地址
branch_id
integer
分支ID
is_deleted
boolean
分支是否已删除
deleted_unix
integer
分支删除的时间
deleted_by
object
分支删除者
示例成功示例
{
"total_count": 1,
"branches": [
{
"name": "main_new",
"commit": {
"id": "e21237dc877b21b009c27554c9aa61ec819ea67d",
"message": "Add ceshi\n",
"author": {
"id": "110",
"login": "yystopf",
"name": "咸蛋黄土豆丝xxx",
"type": "User",
"image_url": "system/lets/letter_avatars/2/X/230_139_26/120.png"
},
"committer": {
"id": "110",
"login": "yystopf",
"name": "咸蛋黄土豆丝xxx",
"type": "User",
"image_url": "system/lets/letter_avatars/2/X/230_139_26/120.png"
},
"time_ago": "29天前",
"timestamp": "2023-12-05T15:06:05+08:00"
},
"protected": false,
"user_can_push": true,
"user_can_merge": true,
"commit_id": "e21237dc877b21b009c27554c9aa61ec819ea67d",
"commit_time_from_now": "29天前",
"commit_time": "2023-12-05T15:06:05+08:00",
"default_branch": "master_1",
"http_url": "http://127.0.0.1:10082/yystopf/ceshi_doc.git",
"zip_url": "http://localhost:3000/api/yystopf/ceshi_doc/archive/main_new.zip",
"tar_url": "http://localhost:3000/api/yystopf/ceshi_doc/archive/main_new.tar.gz",
"branch_id": 7,
"is_deleted": true,
"deleted_unix": 1704243026,
"deleted_by": {
"id": "110",
"login": "yystopf",
"name": "咸蛋黄土豆丝xxx",
"type": "User",
"image_url": "system/lets/letter_avatars/2/X/230_139_26/120.png"
}
}
]
}
最后修改时间: 1 年前