Let's say we have a master
branch.
- I have created a
branch2
with no modification - I have done a few commits in
master
- Then I noticed that
branch2
is a few commits behindmaster
- No problem, I just create a pull request
master -> branch2
, and I merge it - Now going on
branch2
, I expected to see that both are up to date... - ...but in fact it shows
This branch is 1 commit ahead of master.
Why is it so? Does this mean I can never have both up to date again? It seems I could do an infinite loop: if I now do a PR branch2 -> master
(it's possible because branch2 is 1 commit ahead!), and if I merge it, it will be the contrary, master
will be 1 commit ahead of branch2.
What's the clean solution to this problem? If possible, from Github UI, and not from git
command line.
This problem might be solved with "Fast forward" but it is not a direct duplicate of How to do a fast-forward merge on GitHub? since it seems that there are other solutions, not linked with fast forward, such as this option for GitHub to offer to update branches, as suggested in a comment. Thus this question can be solved by various methods, fast forward is only one of them.