开发者

how do I correct the error: pathspec message when committing in git?

I am trying to commit changes with the command git commit "commit message" to a local branch, but am getting the following message:

error: pathspec 'commit message' did not match any file(s) known to git.开发者_如何学运维


It's git commit -m "commit message". You're missing the -m flag.


If you're using Windows you need to use double quotes


Very Good point using double quotes on windows. It cost me hours trying to figure out why the single quote didn't work. Thank you! One thing I want to mention here from my own experience is it seems you still have to do 'git commit -a' for some reason to be able later on to push to the remote git repo such as 'git push'. and it's almost no point doing just 'git commit -m "commit message..."' coz you will type it up in a vi editor again anyway when you do 'git commit -a' on windows. I think only on windows you need to do 'git commit -a' instead of just 'git commmit -m "msg"'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜