如何使用github API列出辅助分支?

时间:2018-01-14 17:00:07

标签: java github

我在Java上使用org.eclipse.egit.github.core api。但是我没有找到任何地方,比如来自给定的存储库,我可以列出它里面的所有分支。

1 个答案:

答案 0 :(得分:1)

看一下源代码,它看起来像在RepositoryService类there is a method中用于拉动存储库的所有分支。基于他们的示例代码,我认为请求看起来像这样:

RepositoryService service = new RepositoryService();
RepositoryId repo = new RepositoryId("rails", "rails");
for (RepositoryBranch branch : service.getBranches(repo))
  System.out.println(branch.getName());