This can create a local branch:
git checkout staging git checkout -b newBranch
or, one line:
git checkout -b newBranch staging
This will start with the current HEAD staging , but note that the branch does not actually come from another branch: it comes from a commit (and this commit can be part of several branches).
Then you can push the new branch tracking the remote branch with one command:
git push -u origin newBranch
source share