Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Is there a way to merge pull requests from the command line?

Hello: I noticed there were couple of threads about "creating" a pull-request from the command line on my client side (without logging into bitbucket repo via a browser).

I have a follow-on question. Is there a way to "merge" and optionally delete the pull request (which one can do from the browser) but from the remote client via the command line? Thanks,

 

1 answer

1 accepted

0 votes
Answer accepted
edwin Community Leader Dec 29, 2019

Hi @ramnadtester ,

Yes it possible through API.

https://docs.atlassian.com/bitbucket-server/rest/6.9.1/bitbucket-rest.html#idp289

For example:

curl -H "Content-Type:application/json" -H "Accept:application/json" --user admin:admin -X POST http://<Your_Stash_URL>//rest/api/1.0/projects/<PROJECT_ID>/repos/<REPO_ID>/pull-requests/<PR_ID>/merge?version=0

Thank you .. will give it a try!

Like edwin likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,804 views 0 7
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