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

Next challenges

Recent achievements

Recognition

  • Give kudos
  • My kudos

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

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.

It would be great if Atlassian could make a way to let us just cherry-pick in the PR interface so we don't have to create a branch in these cases. Would save a lot of time.

Like # people like this

Yes that would be great please

Like # people like this

That would be amazing!

Like # people like this

That would be extremely useful. Is there anyway we can suggest this as a feature?

+1 on this feature please. Just arrived here while wanting to do the same. Would really help in a lot of use cases, with many devs, many branches and many features. Some commits would need to be merged with one main branch and not with others. Also, there are times where the only way we can merge is raising a PR without permission to directly merge to one branch. Also for hotfixes.
Thanks. 

Sorin L_ I'm New Here Oct 04, 2020

+1 on this feature. Came here looking a way to do exactly this, would be great to have it

This would be great so I don't have to break our team's workflow and go to the command line. Thanks

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,914 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