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

Is it possible to get commits history for one file in gitlab api?

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

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

是否支持Gitlab?

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

GET /projects/:id/repository/commits

有实现此功能的补丁:

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

现在您可以:

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

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

Link to documentation