跳转到内容

cnb-rs repo file list

cnb-rs repo file list [<PATH>] [-r <REF>]
cnb-rs repo file ls   [<PATH>] [-r <REF>]

列出目录内容(PATH 是目录)或看文件 meta(PATH 是文件)。

参数

  • [<PATH>]: 文件 / 目录路径(不传表示仓库根目录)

选项

  • -r, --ref <REF>: 分支名 / commit sha / tag 名(缺省走默认分支)

输出

目录 → 表格:

含义
TYPEtree / blob / link / submodule
NAME子项名
SHAgit 对象哈希前 8 字符

文件 → meta 字段:Type / Path / Name / Size (bytes) / SHA / Encoding(如适用)/ LFS URL(如适用)+ 提示「文件内容请用 raw」

API

路径端点
不带 PATHGET /{repo}/-/git/contents
带 PATHGET /{repo}/-/git/contents/{path}

另请参阅

Released under the MIT License.