search

Home  >  Q&A  >  body text

What is the correct way to create a sub-branch under a branch in git?

What is the correct way for git to create a sub-branch under a branch

phpcn_u1582phpcn_u15822793 days ago694

reply all(3)I'll reply

  • 迷茫

    迷茫2017-05-02 09:39:55

    Two steps

    #切换到分支
    git checkout branch1
    
    #基于该分支创建子分支
    git checkout -b branch2_based_on_b1 branch1 

    reply
    0
  • 黄舟

    黄舟2017-05-02 09:39:55

    checkout -b

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-02 09:39:55

    git checkout -b new branch name old branch name (this way of writing means creating a new branch based on the old branch)

    reply
    0
  • Cancelreply