Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

ramnadtester
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 29, 2019

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 Kyalangalilwa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 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
ramnadtester
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 2, 2020

Thank you .. will give it a try!

Like Edwin Kyalangalilwa likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events