Tried the following command:
git commit path/to/my/file.ext -m \'my notes\'
Receive an error in git version 1.5.2.1:
error:
you try if You are in Master branch git commit -m "Commit message" -- filename.ext
If you are in the folder which contains the file
git commit -m 'my notes' ./name_of_file.ext
Your arguments are in the wrong order. Try git commit -m 'my notes' path/to/my/file.ext
, or if you want to be more explicit, git commit -m 'my notes' -- path/to/my/file.ext
.
Incidentally, git v1.5.2.1 is 4.5 years old. You may want to update to a newer version (1.7.8.3 is the current release).
For git 1.9.5 on Windows 7: "my Notes" (double quotes) corrected this issue. In my case putting the file(s) before or after the -m 'message'. made no difference; using single quotes was the problem.
Use the -o
option.
git commit -o path/to/myfile -m "the message"
-o, --only commit only specified files
Try:
git commit -m 'my notes' path/to/my/file.ext