【问题标题】:Not a valid branch name [duplicate]不是有效的分支名称[重复]
【发布时间】:2021-03-08 16:29:57
【问题描述】:

我想在 git 中创建一个名为 [WAP]Testing 的分支。 我试过了

git checkout -b [WAP]Testing

我遇到了错误

fatal: '[WAP]Test' is not a valid branch name

然后我尝试了

git checkout -b '[WAP]Testing' 

as in mentioned here.

但得到同样的错误。

【问题讨论】:

  • [] 不允许出现在分支名称中。更多详情见man git-check-ref-formatwincent.com/wiki/Legal_Git_branch_names
  • 如果他们被允许,你当然希望使用引号来避免分支名称扩展为一个或多个名为WTestingATesting、或PTesting.

标签: git git-branch git-commit


【解决方案1】:

正如提到的herehere,您不能在分支名称中包含[]

引用:

5. They cannot have question-mark ?, asterisk *, or open bracket [ anywhere. 
See the --refspec-pattern option below for an exception to this rule.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-02-07
    • 2016-02-24
    • 1970-01-01
    • 1970-01-01
    • 2011-08-19
    • 1970-01-01
    • 2014-07-17
    相关资源
    最近更新 更多