Why does Bitbucket show a git conflict where there is none?
Asked by Nathan Bennett:

We've had multiple Pull Request created in BitBucket that show conflicts in files (and therefore the PR is not mergeable), but there are no visible conflicts - often BB reports a conflict on simple prs where the only difference is a new line, but often the hash in the \`composer.lock\` file shows as a conflict, when there is clearly only a string change.


Answers:
author: Theodora Boudale
body: Hi Nathan,

Conflicts are indicated by Git, I would advise you to first check if conflicts show locally as well when you run into this issue again. In your local clone of the repo, pull the latest changes for both the source and the destination branch. Then, copy-paste the clone directory to a different location for testing purposes, and try to merge the branches in the copied directory and see if you get any conflicts.

If you don't see any conflicts, I would suggest creating a ticket with the support team to look into this. You can create a ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. In the ticket description please provide the URL of a PR with this issue; the PR needs to be open and not merged yet so we can investigate the issue while it is occurring.

Kind regards,  
Theodora

comments: author: AlexThunder
body: This doesn't seem like an acceptable answer, to be honest. The state of bitbucket cloud is still the same, it says "conflict", but the actual diff of the conflict is not visible in bitbucket. One has to open a merge locally to even know what the conflict is. This feels like an incredible step backwards from the older server versions. For a git management tool, it should help manage git. I assume it's the reason for OP to open this question, because bitbucket doesn't actually show a diff of the conflict.


author: Theodora Boudale
body: Hi Alex,

Thank you for the feedback, I understand that this is a pain point.

We have a request in our issue tracker to show the preview-merge diff type on demand, something that would also show the diff of the conflicts:

* <https://jira.atlassian.com/browse/BCLOUD-21964>

I would suggest adding your vote to that ticket to express your interest and leave feedback there, as this helps our product managers better understand the demand for features.

You can also add yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates. Implementation of features is done as per our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted on that public ticket.

Kind regards,  
Theodora


author: AlexThunder
body: Thanks Theodora, I gave the issue a +1.


author: Kelvin Tan
body: I am currently running into the similar issue where the bitbucket shows merge conflict on PR, but the feature branch is synced with the main branch. I did a test to merge the feature branch to the main branch with git command and they are just merged fine. I think there maybe some fundamantal issues on my local git repo with how bitbucket handles the merge. my local git repo was working fine for the past 6 months.

I even did a test with create a branch on top of the latest main, and made a line change, and created a PR, the bitbucket still complains there's a merge conflict.

Any advice on resolving this issue?

comments: author: Theodora Boudale
body: Hi Kelvin,

I would suggest creating a ticket with the support team so we can investigate this further. If we have a support ticket, the engineer working on it will be able to access the affected PR and investigate.

You can create a ticket via <https://support.atlassian.com/contact/#/>; in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as a product. In the ticket description please provide the URL of an affected PR (that is not merged yet) and explain what the issue is.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud

conflict

git

merge

pull-request