Spot the Git Commit Mistake
Question
This git commit command has a problem. What is wrong?
Code
git commit -m Updated the README file
Hint
Messages with spaces need to be quoted.
Explanation
The -m flag expects a commit message as a string. When the message contains spaces, it must be wrapped in quotes. Without quotes, Git interprets only "Updated" as the message and tries to treat "the", "README", and "file" as file paths, causing an error. The corrected command is: git commit -m "Updated the README file"
Related Resources
Related Lessons
- Git Commit
Learn how to write proper commit messages.
Related Cheatsheets
- Git Cheatsheet
Quick reference for git commit syntax.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.