How to Enable Dark mode in dbeaver | Step-by-Step Guide ?
You may have built numerous repositories when experimenting with creating projects in Github to learn git and version control. And after a few months or years, you may have decided to delete some or all of the repositories, so you may have tried deleting them one by one by clicking on your desired repository, then going to settings, and finally clicking on Delete this repository, as seen below.
This is okay if you only have a few repositories. What to do if you have to delete 20-30 repositories. If this is what you are thinking, you have come to the right place. Ourtechroom will help you delete multiple repositories using various methods.
Let's look at two of them.
RepoSweeper is a React.js-based utility that allows you to sort, filter, and control which repositories you want to delete at scale with just a single or few clicks of a button.
The steps are as follows:
1. First get the username of the GitHub repository
Log in to your GitHub account. Then, in the top right corner, click the Profile icon. Then, from the list of options, select Your Profile.
Then, in three places, you will discover your Github username ie. in the URL, immediately below your FullName, and in the menu from which you arrived at the profile page.
In my case, GitHub username is: Diwas777
2 Goto reposweeper site by clicking here.ย
3 Scroll down to find the Username and Token Field.
Copy and paste your Username, in my case Diwas777, then click Generate Access Token.
This will redirect you to your Github with the URL: https://github.com/settings/tokens.
4 Click on the "Generate new token" button just next to the Personal access token(classic).
5 From the list click on Generate new token(Classic).
6 Give the Note a name, then scroll down and check the โ delete repo checkbox, and then click on Generate Token button.
7 Just click on the Windows icon next to the token. This will copy the token to the clipboard.
8 Now Come back to RepoSweeper and paste down the token in the token field and click on the "Generate Repo List" button.
9 Then wait for some time, you will get all your repository present in your GitHub.
Simply click the topmost checkbox to delete the entire repository. Otherwise, choose all of the checkboxes next to your git repo and then click the Delete button.
Here I want to delete that 5 repo so I have selected then click on the Delete button as shown below.
10 Now on the next screen click on the Continue button.
11 In the next screen, you will get a confirmation like Are you sure you want to delete those selected repos? Just click on the Delete button.
Return to your GitHub and refresh the page. You will not find those deleted repositories.
First create a list of the repo you want to delete in the form of โyour_username/repo_nameโ (not a full path of the repo) per line like shown below and save it into a file let's say: repo_to_delete.txtย
Linux and macOS
Then if you are in Linux or macOS then run the below command.
Windows and Powershell
If you are in Windows then open PowerShell and run the below command and click Enter.
In windows, I have placed those repo inside the repo_to_detele.txt file inside E drive.
Using Bashย
Here, we list all of the repos that we want to delete within a variable called repo to delete, and we loop through each of these data, authorizing each of the repos with the token, and then deleting them. Curl is a command-line program that allows us to send requests from clients to servers.
Note that you have to pass your GitHub token in the placeholder YOUR_TOKEN_HERE.
repo_to_delete=(
ย ย "username/repo1"
ย ย "username/repo2"
ย ย "username/repo3"
)
for item in "${repo_to_delete[@]}"
do
ย ย :ย
ย ย curl -XDELETE -H 'Authorization: token YOUR_TOKEN_HERE' "https://api.github.com/repos/$item ";
done