-
-
Save naqushab/1b01e698eb60e6a15c34a2b12ad9cd6a to your computer and use it in GitHub Desktop.
Revisions
-
mrkpatchaa revised this gist
Apr 16, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ ### Use this trick to bulk delete your old repos or old forks (Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5) 1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories 2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list. -
mrkpatchaa revised this gist
Apr 16, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,6 +12,7 @@ 5. Register a new personal access token with a 'delete_repo perm' https://github.com/settings/tokens/new 6. Copy the access_token and run the following line replacing xxx with your access token. **Linux and OS X :** ``` while read r;do curl -XDELETE -H 'Authorization: token xxx' "https://api.github.com/repos/$r ";done < repos -
mrkpatchaa created this gist
Apr 16, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ ### Use this trick to bulk delete your old repos or old forks (Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5) 1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/wildeyes?tab=repositories 2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list. 3. Save that list to some path 4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' \|.*' and replace by empty. 5. Register a new personal access token with a 'delete_repo perm' https://github.com/settings/tokens/new 6. Copy the access_token and run the following line replacing xxx with your access token. **Linux and OS X :** ``` while read r;do curl -XDELETE -H 'Authorization: token xxx' "https://api.github.com/repos/$r ";done < repos ``` **Windows:** ``` get-content D:\repolist.txt | ForEach-Object { Invoke-WebRequest -Uri https://api.github.com/repos/$_ -Method “DELETE” -Headers @{"Authorization"="token xxx"} } ``` ### Caution I have only tested this script on Linux. Have fun :)