Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从bitbucket api 2.0获取最新的标记提交_Api_Bitbucket_Bitbucket Api_Bitbucket Cloud - Fatal编程技术网

从bitbucket api 2.0获取最新的标记提交

从bitbucket api 2.0获取最新的标记提交,api,bitbucket,bitbucket-api,bitbucket-cloud,Api,Bitbucket,Bitbucket Api,Bitbucket Cloud,我正在尝试创建一个实用工具,我需要为它获取提交给特定回购协议的最新标记。 到目前为止,我已经尝试过: curl -X GET \ https://api.bitbucket.org/2.0/repositories/<team>/<reposlug>/refs/tags \ -H 'Accept: */*' \ -H 'Accept-Encoding: gzip, deflate' \ -H 'Authorization: Basic encode

我正在尝试创建一个实用工具,我需要为它获取提交给特定回购协议的最新标记。 到目前为止,我已经尝试过:

    curl -X GET \
  https://api.bitbucket.org/2.0/repositories/<team>/<reposlug>/refs/tags \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Basic encodedpasswd' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Host: api.bitbucket.org'

现在,根据我所参考的文档,
标签
在返回时是专门订购的,但我不明白为什么值
release-1.3
不是响应中的第一个。我想我错过了什么。或者,如果这是预期的顺序,我如何实现按
date
属性排序的标记,以获得最新的标记。

因此,我能够通过使用属性
target.date
上的
排序
来解决这个问题

   curl -X GET \
  https://api.bitbucket.org/2.0/repositories/<team>/<reposlug>/refs/tags?sort=target.date \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Basic encodedpasswd' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Host: api.bitbucket.org'
curl-X GET\
https://api.bitbucket.org/2.0/repositories///refs/tags?sort=target.date \
-H'接受:*/*'\
-H'接受编码:gzip,deflate'\
-H'授权:基本编码密码'\
-H'缓存控制:无缓存'\
-H'连接:保持活力'\
-H'主机:api.bitbucket.org'

所以我可以通过在属性
target.date
上使用
排序
来解决这个问题

   curl -X GET \
  https://api.bitbucket.org/2.0/repositories/<team>/<reposlug>/refs/tags?sort=target.date \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Authorization: Basic encodedpasswd' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Host: api.bitbucket.org'
curl-X GET\
https://api.bitbucket.org/2.0/repositories///refs/tags?sort=target.date \
-H'接受:*/*'\
-H'接受编码:gzip,deflate'\
-H'授权:基本编码密码'\
-H'缓存控制:无缓存'\
-H'连接:保持活力'\
-H'主机:api.bitbucket.org'