【问题标题】:git branch naming on WindowsWindows 上的 git 分支命名
【发布时间】:2018-09-08 23:13:37
【问题描述】:

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

我做错了什么?

【问题讨论】:

    标签: git git-for-windows


    【解决方案1】:

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

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

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

    它们不能以斜线开头或结尾/或包含多个 连续的斜杠(请参阅下面的 --normalize 选项以了解例外情况 这条规则)

    希望对你有帮助

    【讨论】:

      【解决方案2】:

      我在这里不是 100% 确定,但我怀疑前面的“/” 这类似于这个问题 Which characters are illegal within a branch name?

      列表中有一个尾随“/”...所以我怀疑前导斜杠

      【讨论】:

        猜你喜欢
        • 2016-05-20
        • 1970-01-01
        • 2011-10-28
        • 2017-02-05
        • 2017-07-04
        • 2010-11-18
        • 2010-11-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多