github - 切换到新的 git 分支时 -b 和 -B 有区别吗?
问题描述
这可能是一个非常小的问题。我注意到有人在互联网上打字-B
而不是-b
在切换到新分支时。
git checkout -B new_branch
含义是什么,何时使用大写 B。如果-D
我们使用大写 D 标志强制删除。大写B会发生什么。
Force deletion:
git branch -D local_branch
我尝试查看这些很棒的git Flight Rules但没有找到任何东西。
任何帮助,将不胜感激。
解决方案
From git checkout --help
:
git checkout -b|-B <new_branch> [<start point>]
Specifying -b causes a new branch to be created as if git-branch(1) were called
and then checked out. In this case you can use the --track or --no-track
options, which will be passed to git branch. As a convenience, --track without
-b implies branch creation; see the description of --track below.
If -B is given, <new_branch> is created if it doesn’t exist; otherwise, it is
reset.
推荐阅读
- operating-system - 无法在 Plan9 OS 中创建文件
- sql - 错误:“订购”第 3 行或附近的语法错误:按价格订购;^
- google-sheets - 如何检测谷歌表格中一列中0到1的第一个变化?
- apache-spark - LibSVM:了解数据格式
- python - 为什么我的神经网络无法正确分类?
- google-play - 从 Google Play 到 Google Cloud Storage 的统计数据
- r - 从函数中使用反应性(在 Shiny 中)
- react-native - 反应原生请求
- multithreading - 多线程并没有加速程序
- firebase - 如何使用 Flutter 对 Firebase 中的集合进行排序?