Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 1.58 KB

File metadata and controls

58 lines (42 loc) · 1.58 KB

Lesson 01: Git Is Your Decision History

Git records snapshots called commits. GitHub stores a copy of the repository and helps people collaborate; it is not Git itself.

Learn the four views

Run these inside your repository:

git status
git diff
git diff --staged
git log --oneline --decorate -5
  • status says which files differ from the last commit.
  • diff shows unstaged lines.
  • diff --staged shows what the next commit would contain.
  • log shows recorded history.

Make a tiny experiment

Add a section named Questions to MY_SYSTEM.md, with two things you want to understand about NixOS. Inspect it, stage it, inspect the staged version, and commit it:

git diff
git add MY_SYSTEM.md
git diff --staged
git commit -m "docs: record my first NixOS questions"
git push

A good commit is one understandable change with a message explaining why it exists. Do not use git add . until you can account for every changed file.

Challenge

Without changing anything, answer:

  1. Which commit are you on?
  2. Is your working tree clean?
  3. Which remote receives git push?

The commands you need are git log, git status, and git remote -v.

Completion checklist

  • I can explain the difference between Git and GitHub.
  • I used status, diff, diff --staged, and log.
  • I know exactly which repository receives my push.
  • I made one small commit with a meaningful message.
  • I ticked Lesson 01 in PROGRESS.md.

Next: learn how to research with AI, then continue to Lesson 02.