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

How to create a pull request with selected commits?

Suresh Sakhare July 25, 2018

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?

27 answers

1 accepted

0 votes
Answer accepted
Suresh Sakhare August 29, 2018

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.

stephenpostscript May 1, 2019

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
Adrian R. May 14, 2020

Yes that would be great please

Like # people like this
Gutte June 18, 2020

That would be amazing!

Like # people like this
Roland August 9, 2020

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

Chitra Tatachar September 25, 2020

+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. 

Like Kalebe Samuel likes this
Sorin October 4, 2020

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

Speed Franklin October 26, 2020

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

Swathi Krishnamurthy November 2, 2020

+1.  This is a required feature.

Giles Hinton March 1, 2021

+1 - this should be a feature out of the box.  TFS does it and has a much nicer interface to review pull requests.

Justin June 1, 2021

Would love this feature. With multiple devs working against a repos, we find it common place to have multiple commits made (for version protection and code protection) that are not ready for merge to stage or prod. When a pull request is created we have no way currently to cherry pick the commits that are ready to deploy. This limitation leads to multiple branches - one per dev that have to be constantly synchronized overly complicating the dev-ops process. 

5 votes
Eduarda Almeida Leao Marques November 5, 2020

+1 to this feature. A lot of work can be saved with this feature!  

3 votes
Sharada Ramakrishnan November 11, 2020

+1 to this feature

2 votes
Deleted user November 30, 2021

+1 to this feature

2 votes
maddy302 August 5, 2021

+1 to this feature

2 votes
Malgorzata Jesionowska July 8, 2021

+1 to this feature

At times I have a branch for whole epics, but I work on things that are only "seemingly related" (like separate windows). Unfortunately, those 'things' share common assets like textures, which I have to constantly work on, and a texture don' merge at all.

If I have to create a separate branch for each thing I do and all those share common texture, imagine how merging changes on a texture to all those branches would take.

2 votes
Damien Minter July 5, 2021

+1 to this feature

1 vote
Keshava GN July 18, 2022

+1 to this feature

1 vote
Rich Compton January 12, 2021

+1 to this feature

1 vote
Andrew Wagner December 17, 2020

+1 to this feature

0 votes
khoimk December 10, 2023

+10 for this feature

0 votes
khoimk December 10, 2023

+10 for this feature :D

0 votes
Janeshwar Sritharan June 19, 2023

+1 to this feature

0 votes
Gabriel Rabelo March 31, 2023

+1 to this feature

0 votes
Nicoleta A_ Soare February 23, 2023

+1 for this feature

0 votes
Dean Cox November 12, 2022

+1 for this feature

0 votes
Simran November 4, 2022

+1 for the feature

0 votes
Ethan Spessert August 11, 2022

+1 to this feature

0 votes
Aayush Tripathi June 30, 2022

+1 on this feature

0 votes
David V_ Corbin June 9, 2022

The issue I have with the above approach is that of traceability. Consider if there are 5 feature branches ['A'..'E'] each merged onto shared-dev-branch.  Now if is desired to merge three of them  ['A';,'C','E'] from shared-dev-branch to staging-branch.

Six months from now, there is the need to go back and review each of the features where the code originated. The "cherry-pick into a temporary branch" broke that traceability.

0 votes
Jason Newbury February 12, 2022

+1 to this feature

0 votes
Oscar Navarrerete Estévez January 21, 2022

+1 to this feature

0 votes
Alain Van Daele December 7, 2021

(another) +1 to this feature... 

0 votes
Tom Bonanni March 30, 2021

+1 to this feature

0 votes
Giles Hinton March 1, 2021

+1 to this feature

0 votes
Kalebe Samuel February 9, 2021

+1 to this feature

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events