Back to roadmap

Lesson 01

Git Basics

Git keeps track of versions of your project.

Visual Explanation

Ready to run git init.

Saved Checkpoints

A commit is a saved checkpoint of your project.

Three saved project versionsThree commits connect Version 1, Version 2, and Version 3 in order.Version 1Version 2Version 3

The Real Command

Terminal
git init

git init creates an empty Git repository in this folder. Files are not staged or committed yet.

Command Details

git init -b main

-b names the first branch. This starts the repository with a branch named main.

Knowledge Check

Check Your Git Mental Model

Initialize a repository, then make sure the checkpoint idea is clear.

Question 1 of 5

  1. Question 1: current
  2. Question 2: not started
  3. Question 3: not started
  4. Question 4: not started
  5. Question 5: not started
Command Challenge

You opened my-project in the terminal. Type the command that turns this folder into a Git repository.