在GitHub上删除仓库有两种方法:
在GitHub网站上删除仓库
- 1.登录GitHub网站,点击右上角的“Settings”图标,进入设置页面。
- 2.在设置页面的左侧菜单中,点击“Repositories”,进入仓库管理页面。
- 3.在仓库管理页面,点击仓库名称右侧的“Settings”图标,进入仓库设置页面。
- 4.在仓库设置页面,点击“Delete this repository”,弹出确认框,输入仓库名称,点击“I understand the consequences, delete this repository”,即可删除仓库。
使用GitHub API删除仓库
- 1.获取GitHub的Personal Access Token,可以在GitHub网站上的Settings->Developer settings->Personal access tokens页面进行获取,可以设置Token的权限。
- 2.使用curl命令,发送DELETE请求,即可删除仓库。
curl -X DELETE -H 'Authorization: token YOUR_TOKEN' https://api.github.com/repos/OWNER/REPO
其中,YOUR_TOKEN是获取的Token,OWNER是仓库的拥有者,REPO是仓库的名称。