【问题标题】:git commit exclamation results in zsh: illegal modifier:git commit 感叹导致 zsh: 非法修饰符:
【发布时间】:2020-05-20 21:57:23
【问题描述】:

我正在运行 Zsh 的最新可用稳定版本,并且按照传统的提交样式在 git 提交消息中使用 ! 感叹号遇到错误。 https://www.conventionalcommits.org/en/v1.0.0/

→ zsh --version
zsh 5.8 (x86_64-apple-darwin19.3.0)

还有违反 zsh 的提交消息:

→ git commit -am "chore(foo)!: bar"    
zsh: illegal modifier:

我在 Bash、Fish 和 Hyper 中尝试了相同的命令,并且都成功了,没有问题。所以这似乎是另一个不稳定的 Zsh 细微差别。有没有人修复zsh?我真的希望能够使用 -am 速记,而不必进入完整的 git commit 交互式编辑器。

【问题讨论】:

    标签: git zsh commit


    【解决方案1】:

    zsh! 解释为历史扩展的开始。只需使用单引号而不是双引号。

    git commit -am 'chore(foo)!: bar'
    

    【讨论】:

      猜你喜欢
      • 2013-06-22
      • 1970-01-01
      • 1970-01-01
      • 2015-11-24
      • 2023-03-31
      • 1970-01-01
      • 2012-01-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多