使用github api检查两个分支的可合并性,而不创建PR

时间:2017-11-27 02:44:50

标签: git github github-api

我的评论中的问题: How to check mergeability of a branches using the github api

是否可以在不制作PR的情况下使用github API检查两个分支的可合并性?我不想通过创建PR来触发任何事情,即使我之后立即删除PR。

1 个答案:

答案 0 :(得分:2)

您可以尝试使用GitHub API compare commits(可用于分支),因为illustrated here

这会给你一个状态:

  "status": "behind",
  "ahead_by": 1,
  "behind_by": 2,

如果你只看到前方:分支将很容易合并(快进) 如果你看到前后两个......可能会有冲突,但很难确定。