After running the following commands:
git checkout feature
git add .
git commit -m "done"
git push
Over on GitHub, it shows that feature
branch is 1 commit ahead of main
, I believe the graph looks something like this:
*(main)
- - *(feature)
I then merged the pull request from feature
into main
using the “rebase and merge” option.
However, after merging, the feature
branch now shows:
This branch is 1 commit ahead of, 1 commit behind main
I expected the main
and feature
branches to be in sync at this point, with a graph like this:
*
- - *(main,feature)
The graph actually looks like this:
Why does this discrepancy occur?
3