TutreNews Learn

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 .git folder.
  • 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

  1. Create and enter a folder.
  2. git init creates the hidden .git folder.
  3. git status confirms: no commits yet.
mkdir recipes
cd recipes
git init
git status