Skip to main content

Command referencegh repo delete

gh repo delete command (Linux & Windows / GitHub CLI)

Linux & WindowsGitHub CLIgitadvancedDestructive — use carefully

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 / optionMeaning
repositoryOWNER/REPO to delete.
--yesSkip 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.

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.