x gh repo
仓库管理
例子
罗列输出当前用户仓库
x gh repo ls开启交互式表格查看当前用户仓库
x gh repo app子命令
| 名称 | 描述 |
|---|---|
| x gh repo browse | 使用浏览器打开仓库 |
| x gh repo ls | 交互式表格显示所属地址仓库 |
| x gh repo ll | 罗列仓库 |
| x gh repo info | 显示仓库信息 |
| x gh repo create | 创建仓库 |
| x gh repo edit | 修改仓库信息 |
| x gh repo rename | 重命名仓库 |
| x gh repo rm | 删除仓库 |
| x gh repo cl | 克隆 GitHub 仓库 |
| x gh repo fork | 复刻 GitHub 仓库 |
| x gh repo download | 下载 GitHub 仓库源码快照 |
| x gh repo apply | 通过声明配置管理仓库 |
| x gh repo team | 罗列仓库的团队列表 |
| x gh repo collaborator | 仓库成员管理 |
| x gh repo file | 仓库文件管理 |
| x gh repo pr | 仓库 pull request 管理 |
| x gh repo hook | 仓库钩子管理 |
| x gh repo branch | 仓库分支管理 |
| x gh repo tag | 仓库标签管理 |
| x gh repo release | 仓库发布管理 |
| x gh repo label | 仓库 issue 标签管理 |
| x gh repo topic | 仓库的主题分类管理 |
x gh repo ls
交互式表格显示所属地址仓库
x gh repo ls 是一个多命令复合命令, 旨在方便快速使用
x gh user repo lsx gh org repo ls
如果你需要更多控制指令, 请使用他们
- 例子:
开启交互式表格查看当前用户仓库
x gh repo ls开启交互式表格查看组织仓库
x gh repo ls <org_path>用交互式 UI 列出当前所有公开仓库
x gh repo ls --type public用交互式 UI, 根据创建时间,列出当前所有公开仓库
x gh repo ls --type public --sort created- 使用:
x gh repo ls <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 所属地址 |
x gh repo ll
罗列仓库
x gh repo ll 是一个多命令复合命令, 旨在方便快速使用
x gh user repo llx gh org repo ll
如果你需要更多控制指令或者编写脚本, 请使用他们
- 例子:
以列表的形式输出当前用户仓库
x gh repo ll以列表的形式输出组织仓库
x gh repo ll <org_path>用终端表格, 列出当前所有公开仓库
x gh repo ll --type public用终端表格, 根据创建时间,列出当前所有公开仓库
x gh repo ll --type public --sort created- 使用:
x gh repo ll <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 所属地址 |
x gh repo info
显示仓库信息
- 例子:
查看 x-cmd 仓库的信息
x gh repo info x-cmd/x-cmd- 使用:
x gh repo info <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | <所属空间地址>/<仓库地址> |
x gh repo create
创建仓库
x gh repo create 是一个多命令复合命令, 旨在方便快速使用
x gh user repo createx gh org repo create
如果你需要更多控制指令或者编写脚本, 请使用他们
- 例子:
创建一个名为 x-cmd 的公开仓库
x gh repo create --access public x-cmd创建一个 license 为 BSD-2-Clause, 仓库描述为 "it is my repo" 的, 仓库名为 x-cmd 的仓库
x gh repo create --license_template BSD-2-Clause --description "it is my repo" x-cmd- 使用:
x gh repo create <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | <所属空间地址>/<仓库地址> |
x gh repo edit
修改仓库信息
- 例子:
把 x-cmd 仓库改为私人仓库
x gh repo edit --access private user/x-cmd把 x-cmd 仓库重命名为 myrepo
x gh repo edit --name myrepo user/x-cmd把 x-cmd 仓库的默认分支切换成 main, 并关闭仓库的issue 提交功能
x gh repo edit --default_branch main --no_issues user/x-cmd- 使用:
x gh repo edit|ed <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | <所属空间地址>/<仓库地址> |
x gh repo rename
重命名仓库
- 例子:
重命名仓库 <owner>/<old_name> => <new_name>
x gh repo rename -r <owner>/<old_name> <new_name>- 使用:
x gh repo rename <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 仓库重命名 |
x gh repo rm
删除仓库
- 例子:
删除 <owner>/<repo> 仓库
x gh repo rm <owner>/<repo>- 使用:
x gh repo rm <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | <所属空间地址>/<仓库地址> |
x gh repo browse
使用浏览器打开仓库
- 使用:
x gh repo browse|b <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | <所属空间地址>/<仓库地址> |
x gh repo cl
克隆 GitHub 仓库
- 使用:
x gh repo cl|clone <#1> <#2>- 参数:
| 参数 | 描述 |
|---|---|
#1 | <所属空间地址>/<仓库地址> |
#2 | 目录 |
x gh repo fork
复刻 GitHub 仓库
- 例子:
复制 <owner/repo> 仓库到当前用户仓库中
x gh repo fork <owner/repo>- 使用:
x gh repo fork <#1>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 目标仓库 <所属空间地址>/<仓库地址> |
x gh repo download
下载 GitHub 仓库源码快照
- 例子:
下载 <owner>/<repo> 仓库默认分支的 tar 压缩包快照于当前目录
x gh repo download <owner>/<repo>下载 <owner>/<repo> 仓库并指定的提交指针 <commit SHA|branch|tag> 的 zip 压缩包快照于当前目录
x gh repo download <owner>/<repo>@<git_ref> ./<repo>.zip下载 <owner>/<repo> 仓库并解压仓库文件到 <dir> 目录路径
x gh repo download <owner>/<repo> ./<dir>- 使用:
x gh repo download <#1> <#2>- 参数:
| 参数 | 描述 |
|---|---|
#1 | <所属空间地址>/<仓库地址> (默认分支) 或 <所属空间地址>/<仓库地址>@<提交对象的指针> |
#2 | .tar.gz 或 .zip 压缩包文件路径 或 解压仓库文件到指定目录路径 |
x gh repo apply
通过声明配置管理仓库
- 例子:
使用 repo.yml 声明配置管理仓库
x gh repo apply ./repo.yml使用 repo.yml 声明配置管理仓库, 并将配置中的别名用户 'bot' 替换为 'x-cmd-bot'
x gh repo apply ./repo.yml bot=x-cmd-bot使用标准输入流配置数据管理仓库
cat ./repo.yml | x gh repo apply -- 使用:
x gh repo apply <#1> <#n>- 参数:
| 参数 | 描述 |
|---|---|
#1 | 声明式配置文件路径(yml, json), stdin '-' |
#n | 别名替换列表 |
x gh repo team
罗列仓库的团队列表
- 使用:
x gh repo teamTIP
在交互式终端中(如 zsh, bash ...),可以使用 Tab 获取补全信息
运行 CMD SUBCOMMAND --help 可以获取命令的更多信息
本文作者
转载请注明本文出处及链接
帮助我们改善文档
X-CMD 的文档内容来自命令的帮助文档、多个数据源以及文档库生成。文档中如果有错误或不明确的地方,欢迎通过这些方式进行告知~
扫描添加小助手完成验证加入微信群