Mild Fuzz
Mild Fuzz

Reputation: 30691

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.

Upvotes: 31

Views: 28935

Answers (3)

Xu Cao
Xu Cao

Reputation: 21

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"'

Upvotes: 2

user2018766
user2018766

Reputation: 351

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

Upvotes: 35

Mark Rushakoff
Mark Rushakoff

Reputation: 258188

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

Upvotes: 57

Related Questions