Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 624
user2457644 Avatar asked Jun 05 '13 22:06

user2457644


2 Answers

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

like image 198
kan Avatar answered Oct 09 '22 20:10

kan


I would just like to add--

In windows the commit message should be in double quotes (git commit -m "initial commit" instead of git commit -m 'initial commit'), as I spent about an hour, just to figure out that single quote is not working in windows.

like image 20
Nicks Avatar answered Oct 09 '22 21:10

Nicks