Misa (41) [Avatar] Offline
#1
Run git commit --message 'Initial commit of book.'

=> This does not work from a Windows Command Prompt. Double quotes must be used instead of single quotes. I have pasted my output below in bold font.

Is there a better way for me to run the git commands from a Windows environment so that the examples in the book work?


C:UsersJohnDoeGitInPracticeRedux>git commit --message 'Initial commit of book.'
error: pathspec 'commit' did not match any file(s) known to git.
error: pathspec 'of' did not match any file(s) known to git.
error: pathspec 'book.'' did not match any file(s) known to git.

C:UsersJohnDoeGitInPracticeRedux>git commit --message "Initial commit of book."
[master (root-commit) 350a089] Initial commit of book.
1 file changed, 1 insertion(+)
create mode 100644 GitInPractice.asciidoc

C:UsersJohnDoeGitInPracticeRedux>
Mike McQuaid (83) [Avatar] Offline
#2
Re: MEAP v3 1.4.2
Is this the case when using Git Bash on Windows?
Misa (41) [Avatar] Offline
#3
Re: MEAP v3 1.4.2
User error! When I use Git Bash (msysGit distribution) everything is fine - see below.

You might want to make it clear to git newbies like me to be sure to use Git Bash rather than the Windows Command Prompt. And thanks for the instant response.


$ git add GitInPractice.asciidoc
JohnDoe@JOHNDOE-PC ~/GitInPracticeRedux (master)
$ git commit --message 'Add opening joke. Funny?'
[master 1722d1e] Add opening joke. Funny?
1 file changed, 3 insertions(+), 1 deletion(-)
JohnDoe@JOHNDOE-PC ~/GitInPracticeRedux (master)
$
Mike McQuaid (83) [Avatar] Offline
#4
Re: MEAP v3 1.4.2
Glad to hear it. I've updated the text as below and it'll be in the next MEAP. Thanks!

> NOTE: You can follow listings as you work through the book by running the listed commands (in a Terminal on Unix or Git Bash on Windows) and comparing the output to the listing. A POSIX incompatible shell (which includes the Windows Command Prompt without Git Bash) may work for some listings but will fail for others that rely on POSIX syntax (e.g. the use of single quotes).