【问题标题】:github api v3 to fetch contents of a file from a particular branch other than mastergithub api v3 从 master 以外的特定分支获取文件的内容
【发布时间】:2013-02-27 14:49:33
【问题描述】:

如何使用 github v3 contents api 从特定分支获取文件内容 http://developer.github.com/v3/repos/contents/ 我尝试了这些选项 https://api.github.com/repos/'org_name'/'repo_name'/contents/'file_path' https://api.github.com/repos/'org_name'/'repo_name'/contents/'file_path'/?ref=branch_name 或相当多的选项,但它只从 master 分支获取文件内容。

但我需要从 master 以外的分支获取内容。 我知道我错过了一些非常基本的东西,但不知道是什么。 提前致谢

【问题讨论】:

    标签: github


    【解决方案1】:

    这很奇怪,因为它似乎对我有用。这是从 Google 的 GitHub 组织的 tracking-framework 存储库中获取 gh-pages 分支中 index.html 文件的 URL:

    https://api.github.com/repos/google/tracing-framework/contents/index.html?ref=gh-pages

    master 中不存在 index.html 文件。

    你能给出你正在尝试的确切网址吗?

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-08
    • 1970-01-01
    • 2014-10-11
    • 1970-01-01
    • 2013-08-10
    • 2020-09-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多