x gh repo branch
仓库分支管理
子命令
| 名称 | 描述 |
|---|---|
| x gh repo branch ls | 交互式表格显示仓库分支 |
| x gh repo branch ll | 罗列仓库分支列表 |
| x gh repo branch info | 输出仓库分支详细信息 |
| x gh repo branch ref | 输出 Git 数据库的 branch 引用信息 |
| x gh repo branch create | 创建仓库分支 |
| x gh repo branch default | 设置仓库默认分支 |
| x gh repo branch rename | 仓库分支重命名 |
| x gh repo branch rm | 删除仓库分支 |
| x gh repo branch protection | 仓库保护分支管理 |
x gh repo branch ls
交互式表格显示仓库分支
- 例子:
用交互式 UI, 列出 x-cmd/x-cmd 仓库所有的分支
sh
x gh repo branch ls -r x-cmd/x-cmd用交互式 UI, 列出 x-cmd/x-cmd 仓库所有受保护的分支
sh
x gh repo branch ls --protected --repo x-cmd/x-cmd- 使用:
sh
x gh repo branch lsx gh repo branch ll
罗列仓库分支列表
- 例子:
用终端表格, 列出 x-cmd/x-cmd 仓库所有的分支
sh
x gh repo branch ll -r x-cmd/x-cmd用终端表格, 列出 x-cmd/x-cmd 仓库所有受保护的分支
sh
x gh repo branch ll --protected --repo x-cmd/x-cmd- 使用:
sh
x gh repo branch llx gh repo branch info
输出仓库分支详细信息
- 例子:
列出 x-cmd/x-cmd 仓库 main 分支的详细信息
sh
x gh repo branch info --repo x-cmd/x-cmd main- 使用:
sh
x gh repo branch info <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 分支名称 |
x gh repo branch ref
输出 Git 数据库的 branch 引用信息
- 例子:
输出 x-cmd/x-cmd 仓库的 main 分支的引用信息
sh
x gh repo branch ref -r x-cmd/x-cmd main- 使用:
sh
x gh repo branch ref <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 分支名称 |
x gh repo branch create
创建仓库分支
- 使用:
sh
x gh repo branch create <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 分支名称 |
x gh repo branch default
设置仓库默认分支
- 使用:
sh
x gh repo branch default <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 分支名称 |
x gh repo branch rename
仓库分支重命名
- 使用:
sh
x gh repo branch rename <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 分支新名称 |
x gh repo branch rm
删除仓库分支
- 使用:
sh
x gh repo branch rm <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 分支名称 |
x gh repo branch protection
仓库保护分支管理
- 子命令:
| 名称 | 描述 |
|---|---|
| x gh repo branch protection ls | 罗列保护分支 |
| x gh repo branch protection info | 获取保护分支信息 |
| x gh repo branch protection set | 设置仓库保护分支 |
| x gh repo branch protection unset | 移除仓库保护分支策略 |
x gh repo branch protection ls
罗列保护分支
- 使用:
sh
x gh repo branch protection lsx gh repo branch protection info
获取保护分支信息
- 使用:
sh
x gh repo branch protection info <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 分支名称 |
x gh repo branch protection set
设置仓库保护分支
- 使用:
sh
x gh repo branch protection set <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 分支名称 |
x gh repo branch protection unset
移除仓库保护分支策略
- 使用:
sh
x gh repo branch protection unset <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 分支名 |
TIP
在交互式终端中(如 zsh, bash ...),可以使用 Tab 获取补全信息
运行 CMD SUBCOMMAND --help 可以获取命令的更多信息
本文作者
转载请注明本文出处及链接
sh
https://cn.x-cmd.com/mod/gh/repo-branch/
帮助我们改善文档
X-CMD 的文档内容来自命令的帮助文档、多个数据源以及文档库生成。文档中如果有错误或不明确的地方,欢迎通过这些方式进行告知~
扫描添加小助手完成验证加入微信群