← 返回命令列表

Linux command

gh-release 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List releases

gh release list

Create a release

gh release create [tag]

Create with title and notes

gh release create [tag] -t "[title]" -n "[notes]"

Create with assets

gh release create [tag] [file1] [file2]

Create draft release

gh release create [tag] --draft

Download release assets

gh release download [tag]

View a release

gh release view [tag]

Delete a release

gh release delete [tag]

说明

gh release manages GitHub releases for versioned software distribution. Releases package git tags with release notes and downloadable binary assets, providing an official distribution mechanism. The command supports creating releases from existing tags or creating tags automatically. Release notes can be written manually, loaded from files, or auto-generated from commit messages and merged pull requests using the --generate-notes flag. Assets like compiled binaries, packages, and archives can be uploaded during creation or added later.

参数

-t, --title _title_
Release title.
-n, --notes _notes_
Release notes.
-F, --notes-file _file_
Read notes from file.
--draft
Create as draft.
--prerelease
Mark as prerelease.
--generate-notes
Auto-generate notes from commits and PRs.
--target _branch_
Target branch or commit SHA for tag creation.
--latest
Mark as latest release.
--verify-tag
Abort release if the given tag does not exist in the remote repository.
--notes-start-tag _tag_
Tag to use as the starting point for generating release notes.
--discussion-category _name_
Start a discussion in the specified category.
-R, --repo _OWNER/REPO_
Select a different repository.
-p, --pattern _pattern_
Download only assets matching glob pattern.
--archive _format_
Download source archive (zip or tar.gz).
--clobber
Overwrite existing assets of the same name (upload).

FAQ

What is the gh-release command used for?

gh release manages GitHub releases for versioned software distribution. Releases package git tags with release notes and downloadable binary assets, providing an official distribution mechanism. The command supports creating releases from existing tags or creating tags automatically. Release notes can be written manually, loaded from files, or auto-generated from commit messages and merged pull requests using the --generate-notes flag. Assets like compiled binaries, packages, and archives can be uploaded during creation or added later.

How do I run a basic gh-release example?

Run `gh release list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --title _title_ do in gh-release?

Release title.