How do I create a new branch in git?

This question already has an answer here:

  • Create a branch in Git from another branch 5 answers
  • How do you create a remote Git branch? 17 answers

  • To create a new branch called FEATURE , you simply do:

    git branch FEATURE
    

    However, this does not change your current branch.

    Generally you want to start working in the branch you have just created, so to create a branch and have it be your current branch, use:

    git checkout -b FEATURE
    
    链接地址: http://www.djcxy.com/p/4596.html

    上一篇: Git推送到远程分支

    下一篇: 我如何在git中创建一个新的分支?