Git: 如何检索所有受保护的分支?
Git: how can I retrieve all branches that are protected?
我希望能够从受保护的项目中获取所有分支。保护是在gitlab中完成的,所以我不确定是否有API暴露所以我可以从命令行获取它。
我查看了 git branch
命令,但没有看到任何可以告诉我分支是否受保护的信息。
您可以使用 GitLab API for listing protected branches.
GET /projects/:id/protected_branches
从那里,您可以在本地存储库中使用 git config
or git notes
将 "marker" 留给您的分支机构。
我希望能够从受保护的项目中获取所有分支。保护是在gitlab中完成的,所以我不确定是否有API暴露所以我可以从命令行获取它。
我查看了 git branch
命令,但没有看到任何可以告诉我分支是否受保护的信息。
您可以使用 GitLab API for listing protected branches.
GET /projects/:id/protected_branches
从那里,您可以在本地存储库中使用 git config
or git notes
将 "marker" 留给您的分支机构。