Command referencegh release create
gh release create command (Linux & Windows / GitHub CLI)
What it does
Create a GitHub release with tag, title, notes, and optional assets. When people search for gh release create, they usually want practical GitHub CLI flags, safe examples, and how this subcommand fits everyday PR and repo workflows on Linux, Windows, and macOS. Syntax, options, and copyable examples are below.
Create a GitHub release with tag, title, notes, and optional assets.
Syntax
gh release create [<tag>] [<filename>...] [flags]
Common options
| Flag / option | Meaning |
|---|---|
| -t, --title | Release title. |
| -n, --notes | Release notes text. |
| -F, --notes-file | Read notes from a file. |
| -d, --draft | Create as a draft release. |
| -p, --prerelease | Mark as prerelease. |
| --generate-notes | Auto-generate notes from commits/PRs. |
Practical examples
Tagged release
gh release create v1.2.0 --title "v1.2.0" --generate-notes
Creates a release for tag v1.2.0 with generated notes.
Upload asset
gh release create v1.2.0 ./dist/app.zip
Attaches a build artifact to the release.
Draft first
gh release create v1.2.0 --draft --notes-file CHANGELOG.md
Creates a draft so you can review before publishing.
Common mistakes
- Creating a release for a tag that does not exist and forgetting gh can create the tag depending on flags/version.
- Uploading secrets or untested binaries as release assets.
Related commands
- gh release listList published GitHub releases for the repository.
- gh workflow runTrigger a workflow_dispatch event for a GitHub Actions workflow.
- gh pr mergeMerge a pull request using merge commit, squash, or rebase strategies.
- gh auth loginAuthenticate the GitHub CLI with GitHub.com or GitHub Enterprise so other gh commands can run.
- gh pr createCreate a pull request from the current branch with title, body, reviewers, and base branch options.
- gitTrack source history and collaborate through distributed repositories.
- gh repo cloneClone a GitHub repository to your machine using your authenticated gh settings.
- gh pr checkoutCheck out a pull request locally as a branch so you can build, test, or review the changes.
FAQ
What does gh release create do in GitHub CLI?
Create a GitHub release with tag, title, notes, and optional assets.
Does gh release create work on Windows and Linux?
Yes. The GitHub CLI (`gh`) runs on Linux, Windows, and macOS with the same subcommand syntax after you authenticate with `gh auth login`.
What is a practical gh release create example?
Try `gh release create v1.2.0 --title "v1.2.0" --generate-notes` — Creates a release for tag v1.2.0 with generated notes.
Do I need a token in the command line for gh release create?
Prefer `gh auth login` so credentials stay in the system keyring or secure storage. Avoid pasting personal access tokens into shell history.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.