← Lessons/Your First Commit
← Your First Commit

Initialize a repository

Learn

Start tracking: git init

git init turns the current directory into a repository by creating a hidden .git/ folder, where Git keeps every snapshot and setting. -q keeps it quiet.

git status shows you where you are, at every step from now on: which branch you're on, whether there are commits yet, and which files Git can see but isn't tracking.

git init -q
git status

Type each command into the terminal and press Enter.

Run git init (quietly, with -q) to start tracking this folder, then git status to see its state. Notice it reports No commits yet and lists README.md as untracked.

sandbox@opspath: ~
OpsPath sandbox · Debian GNU/Linux 12 · GNU bash 5.2
Your session carries over: files, commits, branches and cd all stick.
Press restart (top right) to go back to this mini lesson's starting point.
Type a command and press Enter. ↑/↓ history · Ctrl+L clear · Ctrl+C cancel line
# ── Step 1 · Initialize a repository ──
# Sign in to run commands — it's free.