Command referencegh repo delete
gh repo delete command (Linux & Windows / GitHub CLI)
What it does
Delete a GitHub repository permanently after confirmation. When people search for gh repo delete, 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.
Delete a GitHub repository permanently after confirmation.
Syntax
gh repo delete [<repository>] [flags]
Common options
| Flag / option | Meaning |
|---|---|
| repository | OWNER/REPO to delete. |
| --yes | Skip the interactive confirmation prompt. |
Practical examples
Delete with prompt
gh repo delete OWNER/old-demo
Asks for confirmation before deleting the remote repository.
Scripted delete
gh repo delete OWNER/old-demo --yes
Deletes without a prompt — use only in controlled automation.
Common mistakes
- Deleting the wrong OWNER/REPO because the shell was in another project.
- Assuming delete is reversible — GitHub retention windows are limited.
Related commands
- gh repo createCreate a new GitHub repository from the current directory or as an empty remote repo.
- gh repo viewDisplay metadata about a GitHub repository in the terminal or open it in a browser.
- gh auth statusShow which GitHub accounts are logged in and whether credentials are valid for each host.
- 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.
- gh pr mergeMerge a pull request using merge commit, squash, or rebase strategies.
- gitTrack source history and collaborate through distributed repositories.
- gh repo cloneClone a GitHub repository to your machine using your authenticated gh settings.
FAQ
What does gh repo delete do in GitHub CLI?
Delete a GitHub repository permanently after confirmation.
Does gh repo delete 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 repo delete example?
Try `gh repo delete OWNER/old-demo` — Asks for confirmation before deleting the remote repository.
Do I need a token in the command line for gh repo delete?
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.