Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create branches on top of exiting branches in git?

Tags:

git

branch

the title says everything. I want to create a branch on top of an existing branch. I tried to do it with switching to a new branch and creating a new branch while still having the branch checked out. But the Bitbucket.org-Page shows that I made something wrong, it just created new branches ahead of the master branch..

Thanks for your time..

like image 558
KevinHKlein Avatar asked Nov 03 '25 14:11

KevinHKlein


1 Answers

Maybe you meant to create branch from another branch. If so, take a look at A successful Git branching model.

In your case it will be like this:

git checkout -b newbranch oldbranch
like image 63
megas Avatar answered Nov 05 '25 05:11

megas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!