如何在不克隆的情况下列出企业 GitHub 存储库中的文件

How to list files from enterprise GitHub repository without cloning

我正在尝试列出企业 GitHub 存储库中存在的文件。我尝试使用 GitHub API 但基础 URL 是 api.github.com 其中 base URL 对我来说会有所不同,当我输入 URL 时它说无法解析。我怎样才能实现下面格式的 URL https://company.net/org/reponame

下面的示例对我有用,但我拥有的 URL 不起作用 curl -k https://api.github.com/user/repo?refs=master

对于本地 GitHub 企业,documentation mentions

REST API endpoints — except Management Console API endpoints — are prefixed with the following URL:

http(s)://[hostname]/api/v3

你的情况:https://company.net/api/v3

从那里开始,使用 Git Database API -- list tree, you can list all files, as illustrated here