我必须使用gitlab服务来找出主服务器和特性分支之间漏掉的提交。获得这些细节的卷曲和语法是什么?
发布于 2022-02-16 08:22:15
您可以通过使用Gitlab API来实现这一点。
GET /projects/:id/repository/compare更多信息请访问https://docs.gitlab.com/ee/api/repositories.html#compare-branches-tags-or-commits
通过执行以下操作
curl -s --header "PRIVATE-TOKEN: <access_token>" "https://gitlab.com/api/v4/projects/<project_id>/repository/compare?from=<branch_name_behind_in_commits>&to=<branch_name_ahead_in_commits>&straight=true" | jq '. | .commits[] | "\(.id) \(.message)"'您将获得提交ids及其消息,这些消息是存在于master_branch而不是feature_branch的。
Notes
如果回购不是公开的
access_token,,则需要将其提供给命令。这是要与之比较分支的项目的ID。

from字段中,您应该传递在提交中落后的分支,与您在to字段中指定的分支相比
https://stackoverflow.com/questions/70113816
复制相似问题