Skip to main content
GitHub 文档
Version:
Free, Pro, & Team
搜索 GitHub Docs
REST API
/
分支
All products
REST API
API Version:
2022-11-28 (latest)
快速入门
概述
Guides
REST API 参考
操作
活动
应用
计费
分支
分支
受保护的分支
检查
Codes of conduct
代码扫描
Codespaces
协作者
提交
Copilot
Dependabot
依赖项关系图
部署密钥
部署
表情符号
Gists
Git 数据库
Gitignore
交互
问题
许可证
Markdown
元数据
指标
迁移
组织
包
页
Projects (classic)
拉取
速率限制
反应
发行版本
存储库
搜索
机密扫描
安全通知
Teams
用户
仓库 web 挂钩
REST API 现已经过版本控制。
有关详细信息,请参阅“
关于 API 版本控制
”。
REST API
/
分支
分支
使用 REST API 修改分支及其保护设置。
Branches
List branches
Get a branch
Rename a branch
Sync a fork branch with the upstream repository
Merge a branch
Branch protection
Get branch protection
Update branch protection
Delete branch protection
Get admin branch protection
Set admin branch protection
Delete admin branch protection
Get pull request review protection
Update pull request review protection
Delete pull request review protection
Get commit signature protection
Create commit signature protection
Delete commit signature protection
Get status checks protection
Update status check protection
Remove status check protection
Get all status check contexts
Add status check contexts
Set status check contexts
Remove status check contexts
Get access restrictions
Delete access restrictions
Get apps with access to the protected branch
Add app access restrictions
Set app access restrictions
Remove app access restrictions
Get teams with access to the protected branch
Add team access restrictions
Set team access restrictions
Remove team access restrictions
Get users with access to the protected branch
Add user access restrictions
Set user access restrictions
Remove user access restrictions