GitHub删除锁定的仓库-github delete locked respority

2020/02/25 行走的问题解决机 git 共 857 字,约 3 分钟

有时候我们fork别人的仓库后,仓库被别人锁死了:

This repository has been disabled.

Access to this repository has been disabled by GitHub Staff due to a violation of GitHub’s terms of service. Please contact support@github.com for more information or to request a review of this decision.

这时候一个锁死的仓库,自己打不开,又无法删除。

GraphQL

我想到的解决方法是使用GraphQL进行操作,官网:GitHub GraphQL API v4 GitHub Developer Guide

可以使用curl进行GraphQL操作

先申请token:New personal access token

勾选权限Delete repositories,生成token后运行查询:

记得把token换成自己的token:

curl -H "Authorization: bearer token" -X POST -d \
"{\"query\": \"query { viewer { login }}\" } " \
https://api.github.com/graphql

如果结果显示自己的用户名,表示申请成功:

{"data":{"viewer":{"login":"xxx"}}}

注意,你可以在GraphQL API Explorer | GitHub Developer Guide进行初步的操作使用,但Explorer只能进行查询,无法修改和删除。

GraphQL不行

hub

有人推荐hub,我尝试了一下:

snap install hub --classic

也不行。

发邮件

我最后看到了这个问答:repository - How do I delete a forked GitHub repo that’s unavailable due to DCMA takedown? - Stack Overflow

无法删除,唯一的办法是发邮件给GitHub Support

文档信息

Table of Contents