本文作者
转载请注明本文出处及链接
https://cn.x-cmd.com/mod/gh/repo-file/
帮助我们改善文档
X-CMD 的文档内容来自命令的帮助文档、多个数据源以及文档库生成。文档中如果有错误或不明确的地方,欢迎通过这些方式进行告知~
扫描添加小助手完成验证加入微信群
仓库文件管理
罗列仓库根目录的文件
x gh repo file ls --repo <owner/repo>罗列仓库指定目录 <dir> 的文件
x gh repo file ls --repo <owner/repo> <dir>上传本地 <base_file_path> 文件到 <owner/repo> github 仓库默认分支的 <target_file_path>
x gh repo file upload --repo <owner/repo> --message <commit> --file <base_file_path> <target_file_path>| 名称 | 描述 |
|---|---|
| x gh repo file ls | 罗列仓库目录的文件 |
| x gh repo file tree | 罗列仓库目录的文件树 |
| x gh repo file upload | 上传文件到仓库 |
| x gh repo file download | 从仓库下载文件 |
罗列仓库目录的文件
TIP
最大罗列 1000 文件, 如果想罗列更多文件, 可以使用 x gh repo file tree 命令
x gh repo file ls <#1>| 参数 | 描述 |
|---|---|
#1 | 仓库目录路径. 默认为根目录 |
罗列仓库目录的文件树
TIP
当使用递归参数时, 树数组的限制为 100,000 个, 最大为 7 MB.
x gh repo file tree <#1>| 参数 | 描述 |
|---|---|
#1 | 目标 tree sha. 默认为仓库根目录 |
上传文件到仓库
上传本地 <base_file_path> 文件到 <owner/repo> github 仓库默认分支的 <target_file_path>
x gh repo file upload --repo <owner/repo> --message <commit> --file <base_file_path> <target_file_path>x gh repo file upload <#1>| 参数 | 描述 |
|---|---|
#1 | 目标上传仓库路径 |
从仓库下载文件
x gh repo file download <#1> <#2>| 参数 | 描述 |
|---|---|
#1 | 目标仓库文件路径 |
#2 | 下载到指定本地文件路径. (可选 下载到当前目录) |
TIP
在交互式终端中(如 zsh, bash ...),可以使用 Tab 获取补全信息
运行 CMD SUBCOMMAND --help 可以获取命令的更多信息
本文作者
转载请注明本文出处及链接
帮助我们改善文档
X-CMD 的文档内容来自命令的帮助文档、多个数据源以及文档库生成。文档中如果有错误或不明确的地方,欢迎通过这些方式进行告知~
扫描添加小助手