Skip to content

Instantly share code, notes, and snippets.

@show0k
Last active October 25, 2017 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save show0k/2005e648c190109db310ab600e655a15 to your computer and use it in GitHub Desktop.
Save show0k/2005e648c190109db310ab600e655a15 to your computer and use it in GitHub Desktop.
Delete Old GitHub repositories
#!/bin/bash
# Create a file repo_list.twt with repositories you want to delete separated by a new line like
# usename/repo1
# username/repo2
FILE=repo_list.txt
# Replace xxx by your token with delete right on https://github.com/settings/tokens
while read r; do
echo $r
curl -XDELETE -H 'Authorization: token xxx' "https://api.github.com/repos/$r "
done < "$FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment