In my project the master branch contains the released state and the development branch is where the development is done.
The project was initially imported from SVN into the master branch and then development branch was created. The project was worked on using the development branch.
After a while, I wanted to merge development with master but got a conflict. (I think I may have inadvertantly added a CHANGELOG file to the master branch) Github displayed a message like The source branch is 1 commits behind the target branch. Anyway, I decided to merge the master back into the development branch and that seemed to fix the problem. I was able to merge the development branch with the master.
A short while later I wanted to merge development to master a second time and got a similar message The source branch is 2 commits behind the target branch. This seems to indicate that my previous action did not solve the problem.
Why is my development branch behind the master branch? What do I have to do to get them back in sync?
The graph looks like this

I'm obviously doing something wrong here but I don't understand what it could be.
It is not recommended to merge master branch to development branch.
If you want to keep your development branch updated with master branch, you should use git rebase.
A---B---C development
/
D---E---F---G master
After you run either of the following commands:
git rebase master
git rebase master development
your commit history would be:
A'--B'--C' development
/
D---E---F---G master
The graph looks odd: In the line Merge branch 'development' into 'master', the purple branch was mergen into master. But the red branch is the one marked as development. It looks like some other development branch was merged into master.
The message The source branch is 2 commits behind the target branch means there are two commits reachable from the target (master) branch but not from the source branch (development). I would guess these are the First prod release and Merge branch 'development' into 'master' commits, but we would need to see more of your repositories history to know for sure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With