Skip to content

Lesson 04 — Status, Staging, and Commits

Make a small file change and save it in Git history as a commit.

edit → status → add → commit → status
Terminal window
git status

Shows what changed.

Terminal window
git add filename

Stages a file. Staging means: “include this in my next commit.”

Terminal window
git commit -m "message"

Creates a saved checkpoint in Git history.

Run:

Terminal window
git status
  • I know whether my working tree is clean or has changes.

Edit a file, such as README.md.

Example change:

Practicing Git basics.
  • I made one small file change.

Run:

Terminal window
git status
  • I can see the changed file listed.

Run:

Terminal window
git add README.md

Replace README.md with the file you changed.

  • I staged the file.

Run:

Terminal window
git status
  • I can see that the change is staged.

Run:

Terminal window
git commit -m "docs: practice a README change"
  • I created a commit.

Run:

Terminal window
git status
  • Git says there is nothing to commit.

A good commit message is short and specific.

Examples:

docs: update README instructions
fix: correct typo in analysis notes
chore: add project folder structure
  • I can make a small change.
  • I can stage a change with git add.
  • I can commit a change with git commit.
  • I understand that commits are local until pushed.