user2457644 user2457644 - 1 year ago 135
Git Question

git commit error: pathspec 'commit' did not match any file(s) known to git

I am trying to upload a Ruby app to Heroku. I start with

git init
and then I type
git add .
and then I use
git commit -m initial commit

Whenever I use
git commit -m
, I receive an error message saying:

git commit error:pathspect 'commit' did not match any file(s) known to git.

I have been told that this is happening because the arguments are in the wrong order.

The thing I noticed is that when I use
git add .
it will not list the files that are being added because it will just go to the next line.

I suspect that I am having this problem because my files are not really being added.

I would appreciate any advice about how to correct this problem.

kan kan
Answer Source

The command line arguments are separated by space. If you want provide an argument with a space in it, you should quote it. So use git commit -m "initial commit".