How to create a pull request with selected commits? Edited

Hi,

I am trying to create a pull request with selected commits using latest bitbucket cloud rest API. But it creates a pull request with all commits.

Suppose, I have a branch BXI-01 which has four commits i.e commit1,commit2,commit3 and commit4. How can we create a pull request with commit3 and commit4 only? 

 

URL: https://api.bitbucket.org/2.0/repositories/suresh2702/test/pullrequests

Data:

{  
   "title":"Testing pull request created fourth time. with single commit ",
   "close_source_branch":true,
   "destination":{  
      "repository":{  
         "type":"repository",
         "name":"test"
      },
      "branch":{  
         "name":"master"
      }
   },
   "state":"OPEN",
   "source":{  
      "repository":{  
         "type":"repository",
         "name":"test"
      },
      "branch":{  
         "name":"BXI-01"
      },
      "commit":{  
         "hash":"e95bc71987c76503657d273aa7afc6209c4014e8"
      }
   },
   "reviewers":[  
      {  
         "username":"xyz"
      }
   ]
}

 

 UPDATE?

1 answer

1 accepted

0 votes
Answer accepted

Hi Guys,

There is no option to create PR with selected commits. If you want to create PR with selected commits you need to create temp branch and do git cherry-pickup commits and raise the PR with temp branch.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 14, 2019 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...

274 views 0 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you