git commit -m 'first commit' returns error: pathspec 'commit' did not match any files(s) known to git.

2,668 views
Skip to first unread message

Joshua Moore

unread,
Jul 8, 2010, 1:58:35 AM7/8/10
to msy...@googlegroups.com
I tried following the initial instructions on github, but got the
error message:
error: pathspec 'commit' did not match any files(s) known to git.

What's wrong here?

Konstantin Khomoutov

unread,
Jul 8, 2010, 11:39:29 AM7/8/10
to msysGit
Possibly you blindly copied some example intended for POSIX-like
systems with sane shell to Windows cmd.exe in which the apostrophe
sign has no special meaning.
To demonstrate:

C:\tmp>mkdir test

C:\tmp>cd test

C:\tmp\test>git init
Initialized empty Git repository in C:/tmp/test/.git/

C:\tmp\test>git commit -m 'first commit'
error: pathspec 'commit'' did not match any file(s) known to git.

C:\tmp\test>git commit -m "first commit"
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)

Joshua Moore

unread,
Jul 8, 2010, 8:55:42 PM7/8/10
to msysGit
Yeah, that must be what happened. Do you know the corresponding
windows command or where I can look em up?

Johannes Schindelin

unread,
Jul 9, 2010, 4:56:39 AM7/9/10
to Joshua Moore, msysGit
Hi,

On Thu, 8 Jul 2010, Joshua Moore wrote:

> Yeah, that must be what happened. Do you know the corresponding
> windows command or where I can look em up?

umm... You quoted (amongst everything else and her dog) the answer to your
own question:

Reply all
Reply to author
Forward
0 new messages