Hello,
I need to get the name of the latest branch. So, I list branches but the order of the list is not by created date desc.
And the below api call doesn't work. Its response is like that "message": "Invalid field name: updated_on"
https://api.bitbucket.org/2.0/repositories/{user_name}/{repo_name}/refs/branches?sort=-updated_on
Thanks & Best Regards,
Mert
I've found the answer. All branches have target field and the target has date field. So, in order to sort the branches by date you need to point target's date by "target.date"
Like below:
https://api.bitbucket.org/2.0/repositories/{user_name}/{repo_name}/refs/branches?sort=-target.date
Hi Mert,
Is this still working for you? I found that the branches were returned in the underlying source control system (for git) and weren't sorted by last updated.
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.