In GitLab I have a project / Repository structure as below.
How do i fetch file list from the branches. As of now I can able to fetch file list from master with the help of the below api. Please help.
The example from the docs for the operation "Get file from repository" supports query parameters to specify the ref (a commit, branch, or tag):
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fmodels%2Fkey%2Erb?ref=master"
Everything before the ?
is the path to the file, and ref=master
is specifying the master
branch, but this can be a commit sha, another branch name, or a tag.