这个
git checkout -b #1-my-awesome-feature
产生错误
error: switch `b' requires a value
用反斜杠转义或用引号括起来都可以
git checkout -b \#1-my-awesome-feature
但这很奇怪
git branch #1-my-awesome-feature
will not产生任何错误,如果您检查它是否是用创建的
git branch --all
没有分支机构。
如果哈希字符不在分支名称的第一个位置,则分支将是created.
git branch feature-#1
执行中git branch
feature-#1
* master
所以我的问题是 hash (#) char 在终端中如何“翻译”以及为什么它在第一位时不起作用?
Thanks!
#
表示评论正在开始(至少在 Linux shell 中)。所以
git checkout -b #1-my-awesome-feature
becomes:
git checkout -b
并抛出错误b
选项需要一个值。
如图所示here,你可以通过转义来解决这个问题#
with a \
或将名称放在单/双引号中:
git checkout -b \#1-my-awesome-feature
git checkout -b "#1-my-awesome-feature"
git checkout -b '#1-my-awesome-feature'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)