Lesson 4 / 26

git init

Turn any folder into a Git repository.

Start tracking a folder

git init creates a hidden .git folder here — that's what makes this a repository.

mkdir my-project && cd my-project
git init

Output:

Initialized empty Git repository in /my-project/.git/

One repo, one root

Run git init once at the project root — nested .git folders inside subfolders will confuse Git, not help it.