问题
I am trying to download a directory inside of a 'release' branch of a repository from Gitlab. I am using API v4.
The branch includes is of the below structure:
- archive
- outputs
- history-2020-01-01T142535
- history-2020-01-15T142559
- history-2020-02-01T142540
I want to get the "history-2020-02-01T142540" directory.
I can get a ZIP archive of the entire branch...
https://<GITLAB_URL>/api/v4/projects/<PROJECT_ID>/repository/archive.zip?sha=<BRANCH_ID>
How do I get a ZIP archive of only a specific folder within that branch?
回答1:
You can't get an archive for a specific file or folder.
But you can do something similar which might help you:
Get file from repository
List repository tree
来源:https://stackoverflow.com/questions/60176078/download-directory-from-a-branch-using-gitlab-api-v4