我想将 GitHub 上的一个 git 仓库存档,而非关闭/删除。我在多个项目中看到了黄色横幅,上面显示 "This repository has been archived by the owner. It is now read-only.",但我找不到如何实现这一点。
示例:
https://github.com/Homebrew/legacy-homebrew
https://github.com/semantic-release/commit-analyzer-v2
我想将 GitHub 上的一个 git 仓库存档,而非关闭/删除。我在多个项目中看到了黄色横幅,上面显示 "This repository has been archived by the owner. It is now read-only.",但我找不到如何实现这一点。
示例:
https://github.com/Homebrew/legacy-homebrew
https://github.com/semantic-release/commit-analyzer-v2
gh archive
:gh repo archive <repository>
这修复了问题1398(“存储库的归档命令”),通过PR 4410("gh repo archive
"),以及提交 ec55482。
您的存储库将标记为“已归档”。
注意:
通过 REST API 解压存储库(2022 年 12 月)
现在,您可以通过 REST API 解压存储库。
以前,只能通过 GraphQL API 或 UI 进行解压。
# GitHub CLI api
# https://cli.github.com/manual/gh_api
gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
/repos/OWNER/REPO \
-F archived=false
使用:
archived
:boolean
是否将此存储库归档。
false
将取消存档先前已归档的存储库。默认值:
false
GitHub 账户
设置
(右上角)危险区域
)取消存档此仓库
输入消息框上方的消息内容
我理解后果,取消存档仓库