尝试以下命令:
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
更新:它不再严格:)
Lil*_*ard 340
你的论点是错误的.尝试git commit -m 'my notes' path/to/my/file.ext,或者如果你想更明确,git commit -m 'my notes' -- path/to/my/file.ext.
顺便说一句,git v1.5.2.1是4.5岁.您可能想要更新到更新的版本(1.7.8.3是当前版本).
wad*_*rld 85
尝试:
git commit -m 'my notes' path/to/my/file.ext
Run Code Online (Sandbox Code Playgroud)
小智 15
如果您在包含该文件的文件夹中
git commit -m 'my notes' ./name_of_file.ext
Run Code Online (Sandbox Code Playgroud)
使用该-o选项.
git commit -o path/to/myfile -m "the message"
Run Code Online (Sandbox Code Playgroud)
-o, - 只提交指定的文件
在输入的提交消息后指定路径,例如:
git commit -m "commit message" path/to/file.extension
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
279814 次 |
| 最近记录: |