create branch from branch git code example

Example 1: git create new branch

// Example for creating a new branch named myNewBranch
git checkout -b myNewBranch

// First Push
git push --set-upstream origin myNewBranch

Example 2: git create branch

$ git checkout -b [name_of_your_new_branch]

Example 3: branch from other branch

// Go first to the branch where you want to make a copy of
git checkout -b subbranch branch

Example 4: git command to create a branch from another branch

$ git checkout -b myfeature dev

Example 5: how to make branch in git command

git branch crazy-experiment

Tags:

Php Example