Git commit Error message


I did twice git commit -m “Complete the first line of dialogue” in staging area and got an error message in red popup box below twice:

$ git commit -m “Complete first line of dialogue”"

git commit -m “Complete first line of dialogue”

Valid Git commands start with the word “git” followed by a space, then the command name.

Lesson is not going ahead, please help.

It sounds like it is stuck. Try to unstick it like this:

  • reload/refresh the web page - test it again
  • use the "I want to restart this exercise " option - test it again
  • post a screenshot of your whole web page if you are still stuck

This is the problem.

you need to add files to the staging area (git add .) before you can commit anything, you can also do a shorthand, both commit and add in the same line:

git commit -a -m "commit message"

the -a flag tells git add all files to the staging area

1 Like

thks it worked on retrying.

1 Like