Recall & Review
beginner
What does the command
git commit -m "message" do?It saves your staged changes to the local repository with a short message describing the changes.
Click to reveal answer
beginner
Why is it important to include a message with your git commit?
The message explains what changes were made, helping you and others understand the history of the project.
Click to reveal answer
beginner
How do you write a commit message directly in the command line?
Use
git commit -m "Your message here" to add a message without opening an editor.Click to reveal answer
intermediate
What happens if you run
git commit without the -m option?Git opens a text editor for you to write a detailed commit message before saving the commit.
Click to reveal answer
beginner
Can you commit changes without a message in git?
No, git requires a commit message to describe the changes. You must provide one either with
-m or in the editor.Click to reveal answer
What does the
-m option do in git commit -m "message"?✗ Incorrect
The
-m option lets you add a commit message directly in the command line.What happens if you omit the
-m option when committing?✗ Incorrect
Without
-m, git opens your default text editor to write the commit message.Why should commit messages be clear and descriptive?
✗ Incorrect
Clear messages help everyone understand the purpose of the changes.
Which command commits staged changes with the message 'Fix typo'?
✗ Incorrect
The message must be inside quotes after the
-m option.Can you commit changes without staging them first?
✗ Incorrect
You need to stage changes with
git add before committing.Explain the purpose and usage of the
git commit -m command.Think about how you save your work with a note explaining what you did.
You got /4 concepts.
Describe what happens if you run
git commit without the -m option and why you might want to do that.Imagine writing a letter instead of a short note.
You got /4 concepts.