I tried the following command:

git commit path/to/my/file.ext -m 'my notes'

And received an error in Git version 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.

Is that incorrect syntax for a single file or directory commits?

Answer:

Arguments were expected in this order…

git commit -m 'my notes' path/to/my/file.ext

And it’s not strict any more 🙂

8 Answers
8

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *