Ugh. Github forces me to type my password for every fork and repository I want to delete. That’s smart and all, but what if one wants to mass-delete a bunch of old, unused, forgotten, dirty little repositories that make his repository list look like a mess? well, that person follows this short guide:

Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click) https://github.com/wildeyes?tab=repositories Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?hl=en to shorten them to a list. Save that list to to a file, and modify each entry so that it’s in the form of “ur_username/repo_name” per line, (not a full URL!). Use multiple cursors /selections for the quickest results with an advanced text editor such as VS Code or sublime (double click a word, then ctrl-d or alt-f3 to have multiple selections). Register a new personal access token with a delete_repo permission at this address https://github.com/settings/tokens/new Use the line appropriate for your operating system below, replacing UR_TOKEN with your access_token. L̶i̶n̶u̶x̶:̶ ̶t̶h̶e̶ ̶a̶c̶u̶t̶e̶ ̶(̶a̶n̶d̶ ̶t̶h̶o̶u̶g̶h̶t̶f̶u̶l̶)̶ ̶r̶e̶a̶d̶e̶r̶ ̶w̶i̶l̶l̶ ̶u̶s̶e̶ ̶a̶ ̶c̶o̶m̶b̶i̶n̶a̶t̶i̶o̶n̶ ̶o̶f̶ ̶x̶a̶r̶g̶s̶ ̶+̶ ̶c̶u̶r̶l̶,̶ ̶a̶n̶d̶ ̶o̶n̶c̶e̶ ̶d̶o̶n̶e̶ ̶w̶i̶l̶l̶ ̶t̶w̶i̶t̶ ̶t̶h̶e̶ ̶l̶i̶n̶e̶ ̶h̶e̶ ̶u̶s̶e̶d̶ ̶t̶o̶ ̶@̶x̶w̶i̶l̶d̶e̶y̶e̶s̶. O̶S̶ ̶X̶:̶ ̶t̶h̶e̶ ̶s̶a̶m̶e̶ ̶l̶i̶n̶e̶ ̶f̶o̶r̶ ̶L̶i̶n̶u̶x̶ ̶s̶h̶o̶u̶l̶d̶ ̶w̶o̶r̶k̶ ̶f̶o̶r̶ ̶y̶o̶u̶ ̶g̶u̶y̶s̶ ̶t̶o̶o̶.̶

OSX + Linux: (Thanks to @whitjck from twitter)

while read repo; do curl -X DELETE -H "Authorization: token UR_TOKEN" " https://api.github.com/repos/$ repo"; done < repos.txt

7. Windows: Run in powershell: