Before you can cook, you need a kitchen. Before you can track code, you need a repository. git init builds one from nothing.
You have nothing — just an empty folder on your computer.
No history, no tracking, no version control.
Running git init
transforms that empty room into a fully-equipped kitchen:
counters, ovens, a filing cabinet for all your recipe versions.
It creates a hidden .git folder
— the brain of your repository.
You've built a fully-equipped Git repository.
The .git folder
now contains everything Git needs to track your project:
📋 objects/ — stores all your snapshots
📁 refs/ — tracks branches and tags
📄 HEAD — points to your current branch
⚙️ config — your repo settings
This is how every open-source project, every startup codebase, and every personal experiment begins — with two words: git init.