What is the difference between “git branch” and “git checkout -b”?

后端 未结 7 1626
礼貌的吻别
礼貌的吻别 2020-11-29 16:18

I used git checkout -b to create a new branch. I think that git branch does the same thing. How do these two commands differ, if they differ at all

相关标签:
7条回答
  • 2020-11-29 16:48

    Full syntax:

    git checkout -b [NEW_BRANCH] [FROM_BRANCH]
    

    The [FROM_BRANCH] is optional. If there's no FROM_BRANCH, git will use the current branch.

    0 讨论(0)
提交回复
热议问题