http://xxxxxx/api/v4/projects/1021/repository/archive?path=/dist/master&private_token=xxxxxxxxx
使用此api可以正常下载文件。
问题1:如何指定下载分支?
问题2:默认下载的是tar.gz格式。我希望可以下载zip的格式,如何指定格式?
希望指引一下在哪里添加参数,或者给个文档地址也行
http://xxxxxx/api/v4/projects/1021/repository/archive?path=/dist/master&private_token=xxxxxxxxx
使用此api可以正常下载文件。
问题1:如何指定下载分支?
问题2:默认下载的是tar.gz格式。我希望可以下载zip的格式,如何指定格式?
希望指引一下在哪里添加参数,或者给个文档地址也行
增加 sha 参数,该参数支持 commit SHA、tag、branch
下载 dev 分支:http://xxxxxx/api/v4/projects/1021/repository/archive?sha=dev&path=/dist/master&private_token=xxxxxxxxx
在地址后直接加格式扩展名:
已 zip 为例:http://xxxxxx/api/v4/projects/1021/repository/archive.zip?path=/dist/master&private_token=xxxxxxxxx
还支持其他的格式:
bz2
tar
tar.bz2
tar.gz
tb2
tbz
tbz2
zip
您好,您可以参考https://docs.gitlab.com/ee/api/repositories.html#get-file-archive