How is my branch is one commit behind master

HOW TO -️ October 18, 2021

I have a branch and I merged it into the master branch (via Pull Request).Then I un-ticked the box to not delete the branch. Now when I look at the branches this particular branch shows as 1 commit behind the master branch.

I don't understand this, how can it be a commit behind when the commit was what was merged from my branch into master? Is there a way to fix this so that it knows it's the same commit?

Answer

It gets worse, I made another change to my branch so now it shows as 1 commit behind and ahead at the same time. Welcome to DevOps.SE, Paul. While it should work that you could do multiple PRs from the same branch I'd say that it is a best practice to make a new branch for each PR. One benefit of this is that you start with any other changes that have been merged to master while your branch has been continuing on.

Initializing...