Resolving conflicts on a Pull Request

naf12 March 14, 2013

So, I have a Pull Request (PR) that someone had submitted that didn't bother to pull before submitting and therefore has conflicts.

I recieve the following message at the top of the PR.

----

Bitbucket cannot automatically merge this request due to conflicts.

Review the conflicts on the Overview tab below. You can then either decline the request or merge it manually on your local system using the following commands:

----

I understand the option of declining the request and making the other dude fix it, but if I follow the steps and merge the changes in locally. I still have to decline the conflicting PR and handle the changes like I normally would from my local machine, correct? If that is the case, the wording on the message seems to fall a bit short. I mean, it won't let me Edit the PR and change the source account to come from my own.

5 answers

1 accepted

2 votes
Answer accepted
m
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.
April 8, 2013

Ned,

Along with this message, Bitbucket presents you with a list of basic commands for manually merging. If you follow the steps, the second step is to pull the incoming request from the requestors repo. So, after you pull their request and merge it (3 step), you push it (4th) step.

The push to Bitbucket resolves the pull request as well. No need to decline...the request gets marked accepted.

I'll see about clarifying the message, I can see where this could be confusing.

Mary

naf12 April 11, 2013

Mary,

Thanks for your response.

I didn't realize that I had permission to push to their repository. Since they had forked off mine, I guess it does make sense that I would have write privileges.

I was pushing the changes to my account and that's where my confusion was coming from. The missing 4th step of pushing back to their remote would've made this a little clearer for me.

Thanks again,

Ned

1 vote
Mohammed Davoodi
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.
February 16, 2017

We've developed a plugin, Power Editor for Bitbucket, that allows you to resolve conflicts on a pull request in the UI. You can check out out here.

It also supports:

  • Adding, renaming and deleting files
  • Editor extensions like preview, view diff and tab and space controls.
  • Editing functionality in pull requests to quickly fix typos in files.
  • Full support for hooks.

 

1 vote
Michael Todd July 14, 2013

Okay, looking at that and trying a few different commands (I'm still new to Git) resolved it. I believe that these were the steps necessary to resolve my error:

  1. Switch to dev branch: git checkout development-branch
  2. Run Git fetch on dev branch: git fetch origin <-- This seems to be the pertinent, missing step.
  3. Check out master: git checkout master
  4. Perform merge: git merge development-branch

Step 4 resulted in a conflict (as it did on BitBucket), which I resolved locally, committed, and pushed. All seems well now. So maybe the command-line instructions on the BitBucket pull request conflict notice need to be updated?

It would also be great to be able to fix a conflict within the pull request itself on the BitBucket website.

m
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.
July 15, 2013

Michael,

Glad you got that resolved! The instructions on the PR dialog are generic; they are the most comon way to resolve the most common conflict; it would not be possible for us to anticipate all the possible conflicts users could find themselves in. Maybe we need to clarify the instructions are generic?

Good luck in your Git adventures!

Mary

0 votes
m
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.
July 14, 2013

Michael,

That message is coming from Git. I've not seen it before. This stack overflow looks pertinent.

http://stackoverflow.com/questions/16862933/how-to-resolve-gits-not-something-we-can-merge-error

Mary

0 votes
Michael Todd July 14, 2013

I have run into this issue as well. When I try to execute the statements listed on BitBucket, I get this output (error in bold):

$ git checkout master
Already on 'master'

$ git merge --no-ff -m 'Merged in development-branch (pull request #7)' remotes/my-company/my-repo/development-branch
fatal: remotes/my-company/my-repo/development-branch - not something we can merge

What am I doing wrong?
m
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.
July 14, 2013

Michael,

That message is coming from Git. I've not seen it before. This stack overflow looks pertinent.

http://stackoverflow.com/questions/16862933/how-to-resolve-gits-not-something-we-can-merge-error

Mary

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events