- 1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click) https://github.com/wildeyes?tab=repositories
- 2. 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 then run this php code
- 3. Register a new personal access token with a delete_repo permission at this address https://github.com/settings/tokens/new
- 4. Use the line appropriate for your operating system below, replacing UR_TOKEN with your access_token.
- 5. 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
6. Windows: Run in powershell:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
get-content D:\repolist.txt | ForEach-Object { Invoke-WebRequest -Uri https://api.github.com/repos/$_ -Method "DELETE" -Headers @{"Authorization"="token UR_TOKEN"} }
0 Nhận xét