Skip to content

JennySnyk/Github-Repo-Deleter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

GitHub Bulk Repository Deleter

This project provides a set of scripts to help you safely delete multiple GitHub repositories at once.

DANGER

This action is irreversible. Deleting a GitHub repository permanently removes it, along with all its code, issues, pull requests, and settings. Please be absolutely certain before proceeding.

Prerequisites

  1. GitHub CLI: You must have the official GitHub CLI installed.
  2. Authentication: You must be logged into your GitHub account through the CLI. If you haven't already, run:
    gh auth login

How to Use

Step 1: Get Your Repository List

First, you need to get a list of all your repositories.

  1. Make the get_repo_list.sh script executable:
    chmod +x get_repo_list.sh
  2. Run the script:
    ./get_repo_list.sh

This will create a file named my_repos.txt containing a list of all your repositories in the owner/repo-name format.

Step 2: Prepare the Deletion Script

Next, you need to specify which repositories you want to delete.

  1. Open the delete_repos.sh file in a text editor.

  2. Open the my_repos.txt file that was created in the previous step.

  3. Copy the full names of the repositories you want to delete from my_repos.txt and paste them into the repos_to_delete array inside delete_repos.sh.

    Example:

    # Before
    repos_to_delete=(
      "your-username/repo-to-delete-1"
      "your-username/repo-to-delete-2"
    )
    
    # After
    repos_to_delete=(
      "JennySnyk/old-project-1"
      "JennySnyk/test-repo-4"
      "JennySnyk/another-one-to-delete"
    )
  4. Save the delete_repos.sh file.

Step 3: Run the Deletion Script

This is the final step where the repositories are deleted.

  1. Make the delete_repos.sh script executable:
    chmod +x delete_repos.sh
  2. Run the script:
    ./delete_repos.sh

The script will display the list of repositories you are about to delete and ask for a final confirmation. Type y and press Enter to proceed. The script will then delete each repository one by one.

About

Useful Tool : Set of scripts to help you safely delete multiple GitHub repositories at once.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages