Gitlab API帮助文档

链接:https://docs.gitlab.com/ee/api/repositories.html
中文链接:https://www.bookstack.cn/read/gitlab-doc-zh/docs-375.md

命令

通过调接口,获取gitlab项目代码的命令:

wget --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.com api/v4/projects/$ID/repository/archive.zip?sha=<commit_sha>

有三个变量:
1.access token:可以手动生成,在gitlab界面输入name,过期时间,选择api。

通过Gitlab API获取某个git代码仓库

2.project id:$ID

通过Gitlab API获取某个git代码仓库

3.sha= commit sha
通过Gitlab API获取某个git代码仓库

实际操作:

wget --header "PRIVATE-TOKEN: *****************" "http://gitlab.***.*** /api/v4/projects/***/repository/archive.zip?sha=*********" -O ****.zip

相关文章: