I have to check the list of files stored under a particular branch with full path. Currently, I could not find a way of accessing it via a rest endpoint
Thanks for your reply Martyn.
My branch has directories inside it. So, I want to list all the files with a relative path from the branch.
$ git ls-tree --name-only feature/API-460
I have some jobs that reference the branch files as part of CI.
Accessing via git command would mean that I have to install git client on the machine that wants to access bitbucket.
So, what I am trying to find is a rest-endpoint that would fetch the same result as:
$ git ls-tree -r feature/API-460
100644 blob 73febeeb4545e1 .gitignore
100755 blob 3126b0bfa7ca db_connection/conf.json
100644 blob 27a08b947d5438b0 sql/v1.0.sql
100644 blob e228c3188f92c9d96 sql/v1.1.sql
100644 blob 71ab229376c83 sql/v1.2.sql
100644 blob 39e425ba26ed91e536b sql/v1.3.sql
I think it will be simpler for you to install a git client on the machine you're using. Then you can use git commands and shell commands to modify the output to your liking.
The only kind of REST endpoint close to what you're looking for is:
You would need to then call that multiple times to manually traverse the directory tree. Ie. it will only list .gitignore, db_connection and sql in the first call. You would then need to make a second call to list the contents of db_connection/ and a third call to list the content of sql/
I hope that helps!
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events