Recently I came across the notification that my branch has diverged. That was when I made a feature branch, pushed it to remote, and did a rebase with master a few days later when I started working on it again.
git checkout -b feature-branch
git push origin feature-branch:feature-branch
...and when in master...
git pull origin master
git checkout feature-branch
git rebase master
But when I want to push my branch again, it says:
On branch feature-branch
Your branch and 'origin/feature-branch' have diverged,
and have 67 and 1 different commit each, respectively.
I found this answer in "Git branch diverged after rebase":
Since you'd already pushed the branch, you should have merged in the source branch, rather than rebasing against it.
Question
After reading this I still don't fully understand what I should've done differently in my flow, and why I still want to be using git rebase. Hope someone can explain this, thanks!