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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,460,129
Community Members
 
Community Events
176
Community Groups

Process for resolving merge conflict in a pull request (Bitbucket Server)

Edited

I was attempting to merge a pull request from a feature branch into my develop branch. The merge failed with the error: Bitbucket cannot automatically merge this request due to conflicts.

The develop branch had some changes that were not merged into my feature branch, which caused this error to happen. 

I went to my local repository, and pulled the changes from the develop branch, and then merged the updated develop branch into my feature branch. I then pushed my feature branch out to the repository. This action didn't change anything with the pull request, and I was still unable to merge (same error message, even though the feature was fully caught up with develop).

Then, reading the help message better, I determined I needed to merge my feature into the develop branch on my local repository. I did this, and pushed the develop branch out. I expected the pull request to update as being merged, but there was no change. The only thing I could figure to do was to delete the pull request, since it was technically already merged. I don't want to have to delete pull requests, I would like to maintain a history of them.

My question is, where did I go wrong? I must have missed something, because I would have expected the pull request to update after both actions (merging updated develop into feature branch, or merging feature into updated develop).

1 comment

You can see the details steps here:

https://confluence.atlassian.com/bitbucket/resolve-merge-conflicts-704414003.html

In short, you resolve the merge conflict locally by checking out your feature branch and then merging the remote develop into it. You will have to resolve the conflicts, commit the merged code and push to the remote feature branch.

You can do the other way too, and it depends on your branching worklflow, but the PR should be automatically updated as merged. You don't have to delete it. If the PR is not getting updated, you are surely missing some step.

Thanks for your response.

The difference in what you said vs what I did is that in my local repository I checked out the develop branch and then updated it to the latest from the remote develop branch. I then checked out my feature branch and merged the updated local develop branch into it. I then pushed the feature branch to the public repository, and the pull request did not change. Although more round-about, it seems like it ultimately did the same thing, but I'm not a GIT expert.

Now, if I understand correctly, if I had foregone updating my local develop and just updated my feature branch directly from the remote develop branch and then pushed that, it would have resolved the issue and updated the pull request?

Hmm, no. Merging from remote develop is same as pulling develop to local and merging from local develop. And you should see the conflict locally when you do that. Hard to say what went wrong without knowing the exact sequence.

The interesting thing was that there wasn't actually a conflict, only that develop was ahead of the feature branch. 

I will have to wait until this happens again and make sure I log the exact steps I take in case I run into the same problem.

Thanks for your time.

huh, you shouldn't get that message for develop being ahead.

> Bitbucket cannot automatically merge this request due to conflicts.

Maybe your remote was ahead of local and that probably explains why you couldn't replicate the conflict locally. Make sure you pull all the changes before doing a merge locally.

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events