git checkout -b newBranch baseBranch
I don't wanna git push origin newBranch
How can I push the newBranch
as a childBranch of baseBranch
After that can I merge the newBranch
directly to master
?
There is no notion of "child branch": a branch is simply a sequence of commits: Your newBranch
simply starts from the current HEAD of baseBranch
, but it is actually composed of all baseBranch
commits, and of the new commits you are about to create.
See more at "Find the parent branch of a Git branch".
You can push newBranch
to GitHub without worrying about baseBranch
.
git push -u origin newBranch
And you can merge that branch to any other branch you want.