尝试以下命令:
git commit path/to/my/file.ext -m 'my notes'
Run Code Online (Sandbox Code Playgroud)
在git版本1.5.2.1中收到错误:
error: pathspec '-m' did not match any file(s) known to git.
error: pathspec 'MY MESSAGE' did not match any file(s) known to git.
Run Code Online (Sandbox Code Playgroud)
单个文件或目录提交的语法是否不正确?
答: 参数都有望在这一顺序...
git commit -m 'my notes' path/to/my/file.ext
更新:它不再严格:)