Windows上的git分支命名

Rob*_*Sim 0 git git-for-windows

当我git checkout -b /dev/myfeature在Windows中执行该命令时,git bash返回此错误: fatal: 'C:/Program Files/Git/dev/myfeature' is not a valid branch name.

我究竟做错了什么?

小智 5

来自https://git-scm.com/docs/git-branch

要创建或删除的分支的名称.新分支名称必须通过git-check-ref-format [1]定义的所有检查.其中一些检查可能会限制分支名称中允许的字符.

https://git-scm.com/docs/git-check-ref-format:

它们不能以斜杠开头或结尾/或包含多个连续斜杠(有关此规则的例外,请参阅下面的--normalize选项)

希望这可以帮助