markdown 清理未使用的GitHub存储库!在6(半) - 自动步骤中删除所有未使用的存储库和忘记分叉!

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 清理未使用的GitHub存储库!在6(半) - 自动步骤中删除所有未使用的存储库和忘记分叉!相关的知识,希望对你有一定的参考价值。

# Clean Up Unused GitHub Repositories!
> Delete all unused repositories and forgotten forks in 6 (semi)-automatic steps!

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:

[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.

[3.] Save that list to to a file somewhere.
The list should be in the form of “ur_username/repo_name” per line, not a full URL!

[4.] Register a new personal access token with a delete_repo permission at this address 
```
https://github.com/settings/tokens/new
```

[5.] Use the line appropriate for your operating system below, replacing UR_TOKEN with your access_token.

[6.] For OSX + Linux: 
```
while read repo; do curl -X DELETE -H "Authorization: token UR_TOKEN" "https://api.github.com/repos/$repo"; done < repos.txt
```

[7.] For Windows: Run in powershell:
```
get-content D:\repolist.txt | ForEach-Object { Invoke-WebRequest -Uri https://api.github.com/repos/$_ -Method "DELETE" -Headers @{"Authorization"="token UR_TOKEN"} }
```
source: https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.mkna857dz

以上是关于markdown 清理未使用的GitHub存储库!在6(半) - 自动步骤中删除所有未使用的存储库和忘记分叉!的主要内容,如果未能解决你的问题,请参考以下文章

使用 hggit 克隆 github 存储库 - 中止:未找到存储库

markdown 强制GitHub正确检测您的存储库主要语言

markdown 如何在github上创建自己的maven存储库

markdown 多个用户ssh配置文件untuk远程存储库github

文件未添加到 Github 上的存储库 - 存储库显示为空

在 GitHub Actions 工作流程中未使用语义发布-monorepo 找到存储库