1

在 Github 网站上,他们列出了哪些分支已合并到 master 中。我想知道如何通过 Github API 列出这些分支。

4

1 回答 1

2

使用 octokit.rb 我找到所有分支,然后对于每个分支,我将其与主分支中的“开发”或“主”进行比较。我看看谁“领先”:

unmerged_branches = client.branches('blainesch/prettyArray').select do |branch|
  client.compare('blainesch/prettyArray', 'dev', branch[:name])[:ahead_by] > 0
end

要找到它看起来像的所有分支:

/repos/octokit/octokit.rb/branches

要找到差异,它看起来像:

/repos/gvaughn/octokit/compare/dev...treeish

于 2014-05-07T03:16:06.263 回答