Git – Create New Branch From Existing Branch

To create a new branch from existing one you first have to checkout new branch locally, then push it to remote so other can see it. Below are the exact commands.

  1. Create new branch based on existing one. New branch will be only local for now.

    git checkout -b {NEW_branch_name} {SOURCE_branch_name}

  2. Push changes to origin; in other words: push newly created branch to remote for everyone else.

    git push origin {NEW_branch_name}

5 thoughts on “Git – Create New Branch From Existing Branch”

Leave a Comment