You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.4 KiB
1.4 KiB
GitHub利用shell脚本批量删除仓库
作者:行癫(盗版必究)
一:环境准备
1.Github账户(有需要批量删除的仓库)
2.一台可以访问Github的Linux服务器
二:批量删除
1.获取Github的token
在 GitHub 的个人设置中,找到 Developer settings -> Personal access tokens,然后点击 Generate new token;确保勾选上 delete_repo 权限,并生成 Token。
2.批量删除脚本
[root@xingdiancloud ~]# cat github_delete.sh
#!/bin/bash
TOKEN="YOUR_PERSONAL_ACCESS_TOKEN"
repos=("repo1" "repo2" "repo3") # 要删除的仓库列表
for repo in "${repos[@]}"
do
curl -X DELETE -H "Authorization: token $TOKEN" "https://api.github.com/repos/YOUR_USERNAME/$repo"
done