How to delete a repository in GitHub

Kenny DuMez
Kenny DuMez
Graphite software engineer


Note

This guide explains this concept in vanilla Git. For Graphite documentation, see our CLI docs.


Deleting a GitHub repository is a significant action that removes the repository's files, commits, branches, and history from GitHub. This guide will walk you through the steps to delete both remote repositories hosted on GitHub and their local counterparts.

Note: Even after deletion, repository data may still be accessible. For more information, see this guide on deleting sensitive data from Git.

Before you proceed with deleting a repository, consider the following:

  • Loss of data: All the repository data, including branches, commits, releases, and the revision history, will be removed.
  • Impact on collaborators: If other users are collaborating on this repository, they will lose access.
  • Linked services and dependencies: If your repository interacts with other services (like continuous integration tools), deleting the repository might disrupt those services.

Deleting a repository on GitHub requires administrative rights to the repository. Follow these steps to delete a repository:

Before deleting your repository, ensure you have backups of any important data, including code, documentation, and related assets.

Open your web browser, log into your GitHub account, and go to the main page of the repository you want to delete.

Click on the "Settings" tab in the repository menu. The Settings page contains various configuration options and administrative tools for your repository.

At the bottom of the settings page, you’ll find a section called "Danger Zone." This area contains options that can significantly alter your repository, including the ability to delete it.

Find the "Delete this repository" button. Click it, and GitHub will ask you to confirm the repository's name to ensure you are deleting the correct repository. Type the repository name and confirm by clicking "I understand the consequences, delete this repository."

Deleting a local repository involves removing the local files and folders associated with the Git repository:

Ensure that no applications or editors are using files within the repository. This helps prevent errors during the deletion process.

Open a terminal or file explorer and navigate to the directory where the repository is located.

You can delete the repository folder by using a command line or through your file system's GUI:

Using the command line:

Terminal
rm -rf /path/to/your/repository

This deletes the repository locally from your machine but has no effect on the remote repository hosted online.

For further reading see the official GitHub documentation.

Git inspired
Graphite's CLI and VS Code extension make working with Git effortless.
Learn more

Graphite
Git stacked on GitHub

Stacked pull requests are easier to read, easier to write, and easier to manage.
Teams that stack ship better software, faster.

Or install our CLI.
Product Screenshot 1
Product Screenshot 2