有没有办法访问 git 存储库,该存储库以前是 public 但现在是私有的?

Is there a way to get access to a git repository which was public but now is private?

对于 https://github.com 上的 public git 存储库,可以使用 API 与 curljq 来列出相关存储库以及一些信息:

curl -G https://api.github.com/search/repositories    \
    --data-urlencode 'q=XXX+size:>25'                 \
    -H "Accept: application/vnd.github.v3.raw+json"   \
    | jq '.items[] | {html_url, watchers_count, language, name}'

虽然这对 public 存储库非常有效,但有没有一种方法可以搜索曾经是 public 但后来被删除或切换为私有的存储库 - 并在它们的状态下访问它们是 public?也就是说,我想知道 git 存储库是否没有像 http://web.archive.org/ 这样的东西。

AFAIK,GitHub 的 Web API 中没有这样的功能 - 我不明白为什么 [=31= 可以直接提供这样的 API ] 授予(元数据)对 已删除或切换到私有 存储库的访问权限。

不过,我相信您可能对 Software Heritage 项目感兴趣: