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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

What does the behind/ahead column mean in the branch view

On 1 of the repo I work, one of the feature branch behind/ahead column says 41/36 (aka 36 ahead and 41 behind). The branch has been merged so I would assume the branch should be behind....

So my questions are:

-What does the behind/ahead column mean ?

- How a branch can be both behing and ahead of another branch ?

Thanks for your help

2 answers

The OP said "The branch has been merged" so I would think the branch should no longer be "Ahead" of the master branch. We have the same issue. The branch has already been merged but it says the branch is still multiple commits "Ahead" of the master branch. When I go to Create a Pull Request, it says "There are no changes. No commits on BranchName that aren't on master." and will not let me click on the "Create pull request" button.

same problem here. 

E.g. I merge /develop into /master. After that, my develop branch is 1 behind master (expected) but still many commits ahead. Creating a new PR from /develop to /master shows me all previous changes again in the description although no files are changed.. 

Like # people like this
1 vote
Mikael Sandberg Community Leader Oct 01, 2019

Hi @brieucdesoutter,

Welcome to Atlassian Community.

What the the behind/ahead column is telling you that you have made changes on your branch that has not yet made it to the default branch (the branch Bitbucket is comparing against), meaning your branch is ahead. If there are changes on the default branch that has not yet made it into your branch, then it means your branch is behind the default branch. A branch can be both ahead and behind at the same time if you have made changes to your branch, and someone else have made changes on the default branch that you have not merged into your branch yet. 

I have a branch with 6 commits, and it shows 4 commits behind master in Bitbucket Cloud. If I click Sync now, what will happen?

In my local repo, when I run git status, both master and branch are up to date with origin/master and origin/branch, respectively.

Mikael Sandberg Community Leader May 11, 2021

@Aquib Mir this should be its own question, and you could reference this on in it.

Anyways, when you click sync it will only sync your local branch to your remote branch. The 4 commits behind master just means that your branch is out of sync with the master, and you should do a merge from master to your branch in order to get the latest changes from master into your branch. When you do this merge depends, I have always recommended my users that do merges from master/dev to their branches often and early, that way you will avoid having to make major changes on your branch at the end.

Clear as mud!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,741 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you