是否有可能在gitlab api中获取一个文件的提交历史记录?

时间:2015-09-06 14:01:30

标签: api gitlab

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

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

Gitlab支持与否?

3 个答案:

答案 0 :(得分:3)

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

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

答案 1 :(得分:1)

现在你可以做到:

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

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

Link to documentation

答案 2 :(得分:0)

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

GET /projects/:id/repository/commits
相关问题