Recording changes
What Git does
Goal: Explain what a repository and a commit are · 7 min
Git is a version control system: it records snapshots of your project so you can see what changed, when, by whom and why — and go back to any earlier state.
- A repository ("repo") is a project folder that Git tracks. Its history lives in a hidden
.gitfolder. - A commit is one saved snapshot with a message, an author, a date and a unique ID (a hash like
3f2a9c1). - Git is distributed: every copy of a repo contains the full history, so you can work offline.
Start tracking a folder with git init, or copy an existing repository with git clone <url>. Before your first commit, tell Git who you are:
git config --global user.name "Ada Lovelace"
git config --global user.email "ada@example.org"Worked example: Starting a repository
- Create and enter a folder.
- git init creates the hidden .git folder.
- git status confirms: no commits yet.
mkdir recipes
cd recipes
git init
git status