LESSON 5
Commits
Learning objective: Save snapshots of your work with commits.
Understand
A commit is a saved snapshot of your project.
You add files to the staging area, then commit them with a message describing the change. Good, small commits with clear messages make history easy to read and undo.
Analogy: A commit is a save point in a game, with a note about what you just did.
See It in Action
Staging and committing:
git add .
git commit -m "Add homepage"How it works:
git add . stages your changes and git commit -m records them with a short, descriptive message.Try It Yourself
- Create or edit a file.
- Stage it with
git add. - Commit it with a clear message.
Quick Quiz
What is a commit?
Challenge
Make two commits with clear, descriptive messages.
Success condition: Your repository history shows two well-described commits.
+10 XP
Lesson Complete
You answered correctly and completed the required practice. Your progress has been saved on this device.
Continue to next lesson →