I am working on a feature branch but before pushing to github for a PR, I wanted to rebase my branch onto the latest main for which I ran the following commands:
git checkout main
git pull origin main // get the latest version
git checkout feature_branch
git rebase main
git push -f origin feature_branch
Even though the push was successful, and git log shows my local branch's history contains the latest commits from main however my PR on Github says This branch is out-of-date with the base branch.
I have previously used merge commit via git pull origin main in a local branch and it has always worked but apparently that's not a recommended approach.
How come the remote main branch isn't in-sync with the local despite local containing the latest commits from main?
Edit:
one thing I did notice getting upon running git rebase main was:
First, rewinding head to replay your work on top of it...
It didn't seem like an error and running git log confirmed that the rebase seemed successful.