我正在尝试将 Ruby 应用程序上传到 Heroku。我从 git init
开始,然后输入 git add .
,然后使用 git commit -m initial commit
。
每当我使用 git commit -m
时,我都会收到一条错误消息:
git commit error:pathspect 'commit' did not match any file(s) known to git.
有人告诉我这是因为参数的顺序错误。
我注意到的是,当我使用 git add .
时,它不会列出正在添加的文件,因为它只会转到下一行。
我怀疑我遇到了这个问题,因为我的文件并没有真正被添加。
我将不胜感激有关如何纠正此问题的任何建议。
最佳答案
命令行参数以空格分隔。如果你想提供一个带有空格的参数,你应该引用它。所以使用 git commit -m "initial commit"
。
关于git 提交错误 : pathspec 'commit' did not match any file(s) known to git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16951207/