Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect diff shown in Bitbucket PR when targeting feature branch that was rebased from master

Nate Venn
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 15, 2025

When creating a pull request into a feature branch that was rebased from master, Bitbucket is showing incorrect diffs. The diff appears to be comparing against master instead of the target feature branch, despite the PR being created against the feature branch.

Steps to Reproduce:

  1. Have a feature branch that was rebased from master
  2. Create a PR targeting this feature branch (not master)
  3. Observe the diff in the PR
  4. Compare this with:
    • Direct file comparison between the two branches in Bitbucket's file browser
    • Local git diff between the same branches

Expected Behavior:

  • PR diff should show only the actual differences between the source and target feature branch
  • PR diff should match:
    • Manual file inspection in Bitbucket's file browser
    • Local git diff results

Actual Behavior:

  • PR shows incorrect diffs that appear to be comparing against master instead of the target feature branch
  • When inspecting the same files directly in Bitbucket's file browser, the files are identical
  • Local git diff shows the correct (no) differences between the branches

Additional Context:

  • This appears to be a Bitbucket-specific issue with diff calculation when the target branch is a rebased feature branch
  • The diff looks correct if targeting master, suggesting Bitbucket might be incorrectly using master as the merge base for the diff calculation

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 16, 2025

Hi Nate and welcome to the community!

A git diff command can be run:

Either with two dots

For example,

 git diff feature..some-branch

Note that there two dots between the branch names. This type of diff takes into account changes in both branches.

Or with three dots

For example,

git diff feature...some-branch

Note that there are three dots between the branch names. This type of diff shows changes only in some-branch, starting at a common ancestor of feature and some-branch. Changes in the destination branch (feature in this case) are not taken into account.


PRs in Bitbucket Cloud use a three dot diff. Do you see the same diff that you see in Bitbucket if you run the following command locally, in a clone of the repo?

git diff feature...some-branch

where feature replace with the destination branch of the PR, and some-branch replace with the source branch of the PR.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events