Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get subfolders and files using gitlab api

Tags:

gitlab

I am using gitlab api to get the files and folders and succeded,

But I can able to get only directory names, not its subfolders and files.

So, how can i get full tree of my repository.

Please let me know.

Thanks in advance, Mallikarjuna

like image 599
Mallikarjuna Avatar asked Sep 23 '13 06:09

Mallikarjuna


1 Answers

According to the API, we can use

GET /projects/:id/repository/tree

to list files and directories in a project. But we can only get the files and directories in top-level of the repo in this way, and sub-directories of directories in top-level with param path.

If you wanna get directories of script/js/components, for example, you can use

GET /projects/:id/repository/tree?path=script/js/components

like image 183
Malcolm Yu Avatar answered Sep 29 '22 02:09

Malcolm Yu