download directory from a branch using Gitlab API v4

孤街醉人 提交于 2021-02-08 10:42:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!