This is a question that is not similar to existing Q&A that I've found. It is closely related to the git workflow that I'm following, which is
- I do git updates in the default master branch, so that I can do
git pull
from time to time. - My updates are pushed to a remote branch for PR.
Now the situation is that I need a quick fix and need to create a git branch from off from the real master on the server, not the master of my local change. But I was unable to do that following the advices I found on the internet.
My current status:
. . .
On branch master
Your branch is ahead of 'origin/master' by 52 commits.
. . .
$ git checkout master
Already on 'master'
Your branch is ahead of 'origin/master' by 52 commits.
git checkout -b new-feature
Branch 'new-feature' set up to track local branch 'master' by rebasing.
Switched to a new branch 'new-feature'
$ git status
On branch new-feature
Your branch is up to date with 'master'.
The problem is that such "up to date with 'master'" is the master of my local change, not the real master on the server, as it is tracking "local branch 'master' ", but I want it to base and track "origin/master
" instead.