Git

获取文件原始内容。Get raw file content.

获取仓库中指定引用(分支、标签或提交)下某个文件的原始内容。通过 max_in_byte 参数限制返回内容的大小。秘密仓库禁止使用。设置 download 参数可触发浏览器下载行为。 Get the raw content of a file under a specified reference (branch, tag, or commit). Supports limiting the returned content size via max_in_byte. Not available for secret repositories. Supports triggering browser download via the download parameter. 访问令牌调用此接口需包含以下权限。Required permissions for access token. repo-code:r

get/{repo}/-/git/raw/{ref_with_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/raw/{ref_with_path}
  • Auth: API key in header Authorization

Path parameters

repostring required

不带.git后缀的仓库名称。格式:组织名称/仓库名称。Repository name without .git suffix. Format: org/repo.

ref_with_pathstring required

包含路径的Git引用。格式:分支名/文件路径,标签名/文件路径,提交哈希/文件路径

Query parameters

max_in_byteinteger

获得文件内容大小限制(字节),0表示使用gitConfig.RawFileLimitInByte配置值。

Response

OK

Changes

No recorded changes to this operation across all 1 revision of this API.