Why a repository?

Lesson 1 of 25 · Git: records, branches, and collaboration

Suppose a small garden guide changes through several seasons. A folder containing guide-final.md, guide-final-new.md, and guide-really-final.md leaves us to remember which version matters and why. Version control lets us record selected states and describe their purpose. Later, we can compare those records instead of relying on filenames.

Git is a distributed version control system. A repository holds its history and related metadata; its working directory is where we edit the files. A commit is a named record of a snapshot of tracked project content, accompanied by a message and other information. Git does not automatically record every keystroke: we choose when and what to record.

Git is software; GitHub is one service that can host Git repositories. The examples here stay on your machine and need no hosting account. A repository on the same disk as the working files is not an independent backup. Keep a separate copy if the work matters.

Next: Prepare a safe workspace.