Github API:查找未标记的提交 [英] Github API: Finding untagged commits

查看:150
本文介绍了Github API:查找未标记的提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能从使用Github API的最新版本中找到所有未标记的提交? 首先,您可以获取使用GitHub API 最新版本(与matest tag)

  GET / repos /:所有者/:回购/​​发行版/最新版

这意味着您可以比较两个提交

  GET / repos /:owner /:repo /比较/:base ...:head 

例如: https://api.github.com/repos/git- for-windows / git / compare / v2.4.5.windows.1 ... master



注释:


  1. 请参阅处理大比较

    lockquote

    响应将包含多达250个提交的比较。

    如果您正在使用更大的提交范围,则可以使用提交列表API 列举范围内的所有提交。


  2. 假设您的发布是在 master 分支上完成的(但是您的可以在另一个分支上创建一个版本



Is it possible to find all untagged commits since the latest release using Github API?

解决方案

First, you can get the latest release with the GitHub API (which matches the matest tag)

GET /repos/:owner/:repo/releases/latest

That means you can then compare two commits:

GET /repos/:owner/:repo/compare/:base...:head

For example: https://api.github.com/repos/git-for-windows/git/compare/v2.4.5.windows.1...master

Notes:

  1. See Working with large comparisons:

    The response will include a comparison of up to 250 commits.
    If you are working with a larger commit range, you can use the Commit List API to enumerate all commits in the range.

  2. This assume your release was done on the master branch (but you can create a release on another branch)

这篇关于Github API:查找未标记的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆