Start a repo
Your first git command
⏱ Est. ~4 min
01 · Read
Every project tracked by git starts with a single command: git init. This command creates a hidden .git folder in your project where git stores all its tracking data. Without this step, git has no idea your project exists.
💡 Picture thisRunning git init is like buying a filing cabinet for a new project. Until you have the cabinet, there's nowhere to sort and store your documents. The cabinet itself sits hidden in the storage room (that's the .git folder), but it quietly keeps everything organized.
Key points
- git init creates a new git repo in the current folder
- It creates a hidden .git directory where all tracking data lives
- git status shows you git's view of the world — tracked, untracked, and modified files
02 · Terminal exercise
Every git project starts the same way: git init. This tells git to start tracking this folder.
(This section is interactive — please enable JavaScript.)
03 · Terminal exercise
Let's create a file for git to track.
(This section is interactive — please enable JavaScript.)
04 · Terminal exercise
See git's view of things.
(This section is interactive — please enable JavaScript.)
05 · Fill in the blank
To have git start tracking a project folder, you run git ___ inside that folder.
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.