LESSON 4

Repositories

Learning objective: Create a Git repository for a project.

Understand

A repository (repo) is a project folder that Git tracks.

Run git init inside a project folder to start tracking it. This creates a hidden .git folder that stores the history. Use git status often to see what Git sees.

Analogy: A repository is like a project folder with a built-in logbook.

See It in Action

Starting a repo:

git init
git status
How it works: git init begins tracking the folder, and git status shows the current state of your files.

Try It Yourself

  1. Create a new folder for a project.
  2. Run git init inside it.
  3. Run git status to see untracked files.

Quick Quiz

What does git init do?

Challenge

Initialize a repository in a new project folder and check its status.

Success condition: Your folder is a Git repository and git status runs.