hub-delete
Delete a repository on GitHub
TLDR
Delete personal repo on GitHub
SYNOPSIS
hub delete [-y|--yes] [<OWNER>/]<REPO>
PARAMETERS
-y, --yes
Skips the confirmation prompt, performing the deletion immediately without user interaction. Use with extreme caution as this action is irreversible.
Specifies the full name of the GitHub repository to delete, including the owner's username or organization name (e.g., octocat/Spoon-Knife). If this argument is omitted, hub delete attempts to delete the repository associated with the current Git working directory's remote.
DESCRIPTION
The hub delete command is part of the hub tool, an indispensable command-line wrapper for Git that seamlessly integrates with GitHub. This specific subcommand provides the capability to permanently delete a GitHub repository directly from your terminal. It's an essential tool for managing and cleaning up GitHub projects, allowing users to remove personal repositories or those within organizations where they possess the necessary administrative permissions. The command prioritizes safety by typically prompting for confirmation before executing the irreversible deletion. It can operate on the current Git repository's remote or a specified repository name. By offering a direct command-line interface for such a critical operation, hub delete significantly streamlines workflows for developers who prefer to remain in the terminal, eliminating the need to navigate the web interface for repository management tasks.
CAVEATS
Deleting a repository is an irreversible action and all its contents, issues, pull requests, wikis, and other associated data will be permanently lost.
This command requires appropriate administrative permissions on the GitHub repository. If you lack these permissions, the operation will fail.
The hub tool must be correctly installed and configured with a GitHub authentication token or credentials for this command to function.
Using the -y or --yes option bypasses the safety confirmation; ensure you are deleting the correct repository when using it.
AUTHENTICATION
hub delete, like other hub commands, relies on GitHub authentication. This is typically managed via a GitHub personal access token (recommended) or, less securely, by storing username and password. Ensure your authentication is properly set up for hub to interact with GitHub APIs.
LOCAL VS. REMOTE DELETION
It's important to understand that hub delete only deletes the repository on GitHub. It does not delete your local Git clone of that repository from your machine. You will need to manually remove the local directory if you wish to do so after the remote deletion.
HISTORY
The hub project, initiated around 2009, was created to enhance Git's capabilities with GitHub-specific functionalities. As hub evolved to provide a comprehensive command-line interface for GitHub, the delete subcommand was introduced to address the crucial task of repository removal. Its development has mirrored the growing need for efficient terminal-based GitHub management, allowing developers to handle the entire lifecycle of a repository—from creation to deletion—without leaving their command line.
SEE ALSO
hub(1), git(1), hub-create(1), hub-fork(1)