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

Pull requests contains all commits for a branch

amit_kumar05 September 1, 2020

Hi, 

 

we are using Bit bucket cloud where repository ABC is subdivided into multiple Folders Say folder 1 and Folder 2  and Branch X and Y is created.

 

When we create a pull request from folder1 in Branch X  to push to Branch Y  with same folder 1.  Pull request basically contains commits for other Users who is working on folder2 which we do not want to merge or commit. Please suggest how to selectively push Folder1 change to Branch Y and ignore other folder 2 related commit from pull requests coming along to it.

 

Thanks and Regards

Amit

1 answer

1 accepted

0 votes
Answer accepted
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 1, 2020

That is expected behavior, Git do not differentiate between commits make to a specific path, it will merge all commits made on a specific branch to another. If you do not want to break out each folder as its own repository you could use Git cherry-pick to merge specific commits, but then you will loose the pull request process part in Bitbucket.

I would recommend that you take a look at maybe using Git subtree, that allows you to have folder A, B etc as separate repositories that you can then bring into your main repository. 

amit_kumar05 September 2, 2020

Hi  Mikael,

 

Thank you very much. I think Git Cherry pick would work for me If as a reviewer I can selectively approve the commit and merge it  in Bit bucket ( similar to cherry pick using Source tree). Cant we still tell developer to create pull request and as a reviewer I can cherry pick and merge specific commit which is relevant for approver. Please suggest if that is possible. Which privilege I should have to do it in Bit bucket.

 

Thanks and Regards

Amit

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events