git - 什么是 git checkout -b <branchname> ?

标签 git

<分区>

什么是 git checkout -b <branchname>对于?

我的意思是,您可以通过执行 git branch <branchname> 创建一个分支

但是,它做了什么git checkout -b <branchname>具体?

最佳答案

这意味着你要做两件事:

  1. 创建一个新分支 <branchname>
  2. 检查新分支 <branchname>

它只是创建一个新分支然后直接 check out 它的简写。

$ git checkout -b new-feature

是以下内容的简写并等效于:

$ git branch new-feature
$ git checkout new-feature

有关引用,请参阅 documentation on git-branch .

关于git - 什么是 git checkout -b <branchname> ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32080865/

相关文章:

git - Bash 脚本协助查找

git - 在保持 'as easy as svn' 的同时教 git

git - 你能*真的*改变 Git 中的作者吗

git - pull 请求和分支有什么区别?

git - 在致命消息后继续

Git - 将旧分支移动到另一个分支叫什么?

特定设备的 Android 源代码

git - 如何仅使用管道命令复制 git-checkout?

git - 我添加了一个名为 "mine"的 Remote ,但我的分支显示在 "origin"下

git - 进行git pull时忽略对特定文件的更改