Making Commits — Snapshots of Your Code
Master the commit workflow: staging changes, writing good commit messages, and building a clean project history.
The Three Areas of Git
The Commit Workflow
# See what files have changed
git status
# Stage specific files
git add index.html
git add styles.css
# Or stage everything at once
git add .
# Commit with a descriptive message
git commit -m "Add navigation bar with responsive menu"
# See what you just committed
git log --onelineWriting Good Commit Messages
Commit early and commit often! Each commit should be one logical change — not a whole day of work lumped together. Small, focused commits make it easy to find when a bug was introduced and undo just that one change without losing everything else.
Create a small project (a simple HTML page) and practice the full Git workflow: 1) Initialize Git with 'git init'. 2) Create index.html and commit it. 3) Add some CSS in a new file and commit. 4) Change the HTML and commit. 5) Run 'git log --oneline' to see your beautiful commit history. Try writing clear, descriptive messages for each commit. Can someone reading just the messages understand what you built?
Ready to build?
Put what you learned into practice — pick a project and start coding.
Start Building Free