Lesson 04 — Status, Staging, and Commits
Make a small file change and save it in Git history as a commit.
Core workflow
Section titled “Core workflow”edit → status → add → commit → statusWhat these commands mean
Section titled “What these commands mean”git statusShows what changed.
git add filenameStages a file. Staging means: “include this in my next commit.”
git commit -m "message"Creates a saved checkpoint in Git history.
Checklist
Section titled “Checklist”1. Start clean
Section titled “1. Start clean”Run:
git status- I know whether my working tree is clean or has changes.
2. Make a small change
Section titled “2. Make a small change”Edit a file, such as README.md.
Example change:
Practicing Git basics.- I made one small file change.
3. Check status again
Section titled “3. Check status again”Run:
git status- I can see the changed file listed.
4. Stage the changed file
Section titled “4. Stage the changed file”Run:
git add README.mdReplace README.md with the file you changed.
- I staged the file.
5. Check status again
Section titled “5. Check status again”Run:
git status- I can see that the change is staged.
6. Commit the change
Section titled “6. Commit the change”Run:
git commit -m "docs: practice a README change"- I created a commit.
7. Check status one more time
Section titled “7. Check status one more time”Run:
git status- Git says there is nothing to commit.
Good commit messages
Section titled “Good commit messages”A good commit message is short and specific.
Examples:
docs: update README instructionsfix: correct typo in analysis noteschore: add project folder structureCompletion check
Section titled “Completion check”- 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.