Git 认为提交消息是未找到的命令

标签 git command-line zsh

我正在学习 Udacity 类(class),输入以下内容后:

g cmp "adds string.replace() quiz"

我收到了错误信息

git:3: command not found: quiz
git:80: command not found: quiz
git:84: command not found: quiz

现在我输入的任何 git 命令都会返回

git:1: command not found: quiz

撤消提交是否可以解决问题?搜索时找不到这样的东西。我正在使用 Zsh,作为记录。

我的 git 别名来自这个 repo: https://github.com/Prelang/g

最佳答案

Zsh interprets some aspects of the contents of double quotes .为确保 zsh 将您的字符串视为原始字符串并且不进行任何解释,您应该使用单引号:

git commit -m 'adds string.replace() quiz'

请注意,您的 git 别名中可能有双引号,这也可能会造成干扰。

关于Git 认为提交消息是未找到的命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37253507/

相关文章:

java - 修改Javadoc

linux - source 命令没有使用 shell 脚本将变量导出到 zsh 环境

node.js - 如何在命令行上将分层配置值传递给 nconf?

git - 为什么 `go get` 尝试访问 http 而不是 https?

linux - 从 git 中删除不存在的文件

windows - 是否可以使用 start 从 cmd 文件使用输出重定向?

Java光滑的命令行应用程序?

git - 如何在没有来源的 Git 上使用 zsh 选项卡补全?

git - 在没有密码提示的情况下从 bitbucket 中获取 pull

git - perforce diff 到 git