Git: records, branches, and collaboration

5 chapters · 25 lessons

Git helps us record selected project snapshots, understand how they relate, and exchange history with others. This course starts with a local repository and ends with ways to correct or replay work. GitHub is introduced as one hosting service, not a requirement for learning Git locally.

Learning path

  1. Recording changes — a safe repository, staging, ignores, and settings.
  2. Understanding history — compare snapshots and inspect Git objects.
  3. Working in parallel — branches, merges, conflicts, and graphs.
  4. Collaborating with others — remotes, hosting, and review.
  5. Correcting course — restore, revert, reset, reflog, and rebase.

Finish with the final assessment. Its multiple-choice questions check conceptual understanding, not independent practical ability.

Before starting

Use a POSIX-style terminal and Git 2.28 or newer, as explained in the first chapter. No hosting account is needed for the local examples; actual hosting and pull-request actions require appropriate access. Examples that follow the garden repository depend on the same shell and repository. Other branch, collaboration, and recovery examples explicitly describe their own assumed state; they are not a single uninterrupted command sequence. Treat placeholders as descriptions to replace, not literal shell input. Inspect status and preserve valuable work outside Git before destructive operations. Read the warnings in context: a local repository is not an independent backup.