Git
查询仓库文件内容。Get repository file content.
根据文件路径查询仓库中的文件内容或目录列表。如果路径指向文件,返回文件内容(Base64 编码)及元数据;如果路径指向目录,返回该目录下的条目列表。通过 ref 参数指定分支或提交。 Query file content or directory listing in the repository by file path. If the path points to a file, returns the file content (Base64 encoded) and metadata; if it points to a directory, returns the entries in that directory. Use the ref parameter to specify a branch or commit. 访问令牌调用此接口需包含以下权限。Required permissions for access token. repo-code:r
get/{repo}/-/git/contents/{file_path}
Request
- Base URL: https://api.cnb.cool (the document declares no server; this is the origin it was published from)
- URL: https://api.cnb.cool/{repo}/-/git/contents/{file_path}
- Auth: API key in header Authorization
Path parameters
repostring required
不带.git后缀的仓库名称。格式:组织名称/仓库名称。Repository name without .git suffix. Format: org/repo.
file_pathstring required
文件路径。File path.
Query parameters
refstring
提交的哈希值或分支名称。Commit hash or branch name.
Response
OK
Changes
No recorded changes to this operation across all 1 revision of this API.