Github的标签方法返回一个列表,其中包含推送到您的存储库中的所有标记,最新的标记位于顶部。以下是一个示例调用:https://api.github.com/repos/ff0000/rosy/tags,它生成以下JSON对象。
[{
name: "rbp-folder-rename",
zipball_url: "https://api.github.com/repos/ff0000/rosy/zipball/rbp-folder-rename",
tarball_url: "https://api.github.com/repos/ff0000/rosy/tarball/rbp-folder-rename",
commit: {
sha: "09ebda2678d932a005fc86ab78f6c04eebdcd50d",
url: "https://api.github.com/repos/ff0000/rosy/commits/09ebda2678d932a005fc86ab78f6c04eebdcd50d"
}
},
{
name: "2.0.10",
zipball_url: "https://api.github.com/repos/ff0000/rosy/zipball/2.0.10",
tarball_url: "https://api.github.com/repos/ff0000/rosy/tarball/2.0.10",
commit: {
sha: "fe284c7d461107d9d08d2d4dcb676759f9485fc1",
url: "https://api.github.com/repos/ff0000/rosy/commits/fe284c7d461107d9d08d2d4dcb676759f9485fc1"
}
},
// ....
{
name: "2.1.5",
zipball_url: "https://api.github.com/repos/ff0000/rosy/zipball/2.1.5",
tarball_url: "https://api.github.com/repos/ff0000/rosy/tarball/2.1.5",
commit: {
sha: "db92baa49657b3c3d27b1475c415c19525cb2118",
url: "https://api.github.com/repos/ff0000/rosy/commits/db92baa49657b3c3d27b1475c415c19525cb2118"
}
}]
问题
- 这个列表似乎在顶部有最新的标签,其后是以相反的时间顺序列出的先前标签的历史记录。为什么?第一个结果与其余结果排序不同,这似乎很奇怪,也许我理解有误?
- 是否有任何编程方法可以仅检索应用于
master
分支的最新版本?我想编写程序来检索存储库的最新稳定版本。
任何帮助/见解将不胜感激。