【问题标题】:Is it possible to get commits history for one file in gitlab api?是否可以在 gitlab api 中获取一个文件的提交历史记录?
【发布时间】:2015-09-06 14:01:30
【问题描述】:

我想在 gitlab api 中获取一个文件的提交或最后一次提交,如下所示:

GET /projects/:id/repository/commits?path=fileName

是否支持 Gitlab?

【问题讨论】:

    标签: api gitlab


    【解决方案1】:

    有一个补丁实现了这个功能:

    https://gitlab.com/gitlab-org/gitlab-ce/issues/18898

    很遗憾,它还没有被合并:

    https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4814

    编辑:现已合并,预计将于 8.14.0 (2016-11-22) 登陆:https://gitlab.com/gitlab-org/gitlab-ce/commit/146d4348ca6812e26729de40a831f4ae8c27fde6

    【讨论】:

      【解决方案2】:

      现在你可以这样做了:

      /projects/:id/repository/commits?path=:file_path
      

      并接收有关特定文件的提交数组。

      Link to documentation

      【讨论】:

      • 我不确定 :file_path 所以我测试了它,这对我有用:/projects/:id/repository/commits?path=README.md
      【解决方案3】:

      很遗憾没有。使用 GitLab 7.14,您只能使用以下命令获取存储库的所有提交:

      GET /projects/:id/repository/commits
      

      【讨论】:

      • 现在没有。您可能想要分析 API 代码并实现该功能:)
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-28
      • 1970-01-01
      • 2013-08-02
      • 1970-01-01
      • 2016-08-06
      • 2020-07-26
      • 2019-08-23
      相关资源
      最近更新 更多