[英]Git checkout <branch_name> is not working
I am aware that git checkout -b "branch_name" will create a new branch and git checkout "branch_name" will switch to the specified branch我知道 git checkout -b "branch_name" 将创建一个新分支, git checkout "branch_name" 将切换到指定的分支
But when I unknowingly did git checkout branch_name (PS there is no quotes surrounding the branch_name) even though it said it is tracking the specified branch I was not able to see the branch level changes.但是,当我在不知不觉中执行 git 结帐分支名称(PS 分支名称周围没有引号)时,即使它说它正在跟踪指定的分支,我也无法看到分支级别的变化。
So are the double quotes mandatory for specifying the branch name during checkout?那么在结帐时指定分支名称是否必须使用双引号?
I have never used quotes for checking out a git branch in 4 years of using git.在使用 git 的 4 年中,我从未使用引号来检查 git 分支。 That being said, you can also do, in case you have a reason for doing so.话虽如此,如果您有理由这样做,您也可以这样做。
git checkout \"branch_name\"
git checkout -b \"branch_name\"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.