0

I have two branches named develop and master. I performed the "Merge develop into master" operation. Then I pushed master and develop to remote repository(github).

When I access the develop branch via Github, I see the warning in the title. This branch is 1 commit ahead, 2 commits behind master.

How is this possible? Both ahead and behind? My goal is to synchronize these two branches. How can I do it?

  • 1
    Please show us the git commands used and their outputs. --- You can be behind, someone else has committed to master, and be ahead, you have committed to master. You could try pulling using rebase to put your changes on top of the remote changes? `git pull --rebase`? – evolutionxbox Dec 02 '21 at 08:17
  • 1
    Did you read https://stackoverflow.com/questions/41283955/github-keeps-saying-this-branch-is-x-commits-ahead-y-commits-behind already? – mkrieger1 Dec 02 '21 at 08:20
  • 1
    Does this answer your question? [GitHub keeps saying "This branch is X commits ahead, Y commits behind"](https://stackoverflow.com/questions/41283955/github-keeps-saying-this-branch-is-x-commits-ahead-y-commits-behind) – evolutionxbox Dec 02 '21 at 08:21
  • @mkrieger1 yes I read it. But I don't use forks. The commands there didn't work. – nulluisinverba Dec 02 '21 at 08:32
  • 1
    `1 ahead, 2 behind` means that your *local* branch has **one** commit unknown to the remote, and the *remote* branch has **two** commits unknown to the local one. Very common situation, for example when you work on a branch locally while a coworker pushes something to the remote branch. Also after a rebase. – Romain Valeri Dec 02 '21 at 09:06
  • I clicked fetch and merge solves my problem – afikri Jul 08 '22 at 15:49

0 Answers0