如何使用新的"git switch"语法创建新分支? [英] How can I use the new `git switch` syntax to create a new branch?
本文介绍了如何使用新的"git switch"语法创建新分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我习惯于 git checkout -b branchname
切换到名为 branchname
的新分支.如何使用 git switch
做同样的事情?
I am used to git checkout -b branchname
to switch to a new branch named branchname
. How do I do the same with git switch
?
推荐答案
使用 git switch
创建新分支的语法是 git switch -c branchname
或 git switch-创建分支名称
.
The syntax for creating a new branch with git switch
is git switch -c branchname
or git switch --create branchname
.
这篇关于如何使用新的"git switch"语法创建新分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文