It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Querying the last commit on a particular branch in Bitbucket using the Rest API Edited

John Doe Apr 17, 2017

Hey guys,

 

Im trying to get the latest commit for a particular branch in stash (deploy).  When I run the rest api call - 

curl -X GET -H "<authentication info>" "http://<ourstashurl>/stash/rest/api/latest/projects/<projectname>/repos/<reponame>/compare/commits?from=deploy&start=0&limit=0"

However, the results that I get from running this are not correct.  I am getting the lastest commit from other branches, but not the "deploy" branch.

 

How should I adjust this rest API call in order to get the latest commit from the "deploy" branch?  The piece of information that I want is the date of the latest commit for the "deploy" branch.

 

Thanks.

1 answer

1 accepted

1 vote
Answer accepted
John Doe Apr 17, 2017

I found the answer - 

 

curl -X GET -H "<some authorization>" -H "Content-Type: application/json" "http://<stashurl>/stash/rest/api/latest/projects/<projectname>/repos/<myrepo>/commits?until=deploy&limit=0&start=0"

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,865 views 1 19
Read article

Community Events

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

Events near you