gh release download
gh release download [<tag>] [flags]
从 GitHub 版本下载资产。
如果没有明确的标签名参数,则会从项目中的最新版本下载资产。在这种情况下,需要--pattern或--archive。
选项
-A,--archive <format>- 以指定格式(zip 或 tar.gz)下载源代码存档
-
--clobber - 覆盖具有相同名称的现有文件
-D,--dir <directory> (default ".")- 要将文件下载到的目录
-O,--output <file>- 要写入单个资产的文件(使用 "-" 写入标准输出)
-p,--pattern <stringArray>- 仅下载与 glob 模式匹配的资产
-
--skip-existing - 当存在相同名称的文件时,跳过下载
从父命令继承的选项
-R,--repo <[HOST/]OWNER/REPO>- 使用 [HOST/]OWNER/REPO 格式选择另一个存储库
示例
# download all assets from a specific release
$ gh release download v1.2.3
# download only Debian packages for the latest release
$ gh release download --pattern '*.deb'
# specify multiple file patterns
$ gh release download -p '*.deb' -p '*.rpm'
# download the archive of the source code for a release
$ gh release download v1.2.3 --archive=zip