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