Follow the ▸ step. Stuck? open the hint.
Chapter 1 / 7
A repository from nothing
init · a file · add · commit
Git turns an ordinary folder into a repository — a folder with memory. Every time you take a snapshot (a commit), git remembers exactly what every file looked like, and you can return to it forever.
There are three places a file can be: your working directory (where you edit), the staging area a.k.a. the *index* (a holding pen for the next snapshot), and the commit history (the permanent record). You move files: edit → git add → git commit.
Let's make one.
- 1▸Turn this folder into a git repository:
git init - 2Create a file. Try:
echo "# My Project" > README.md - 3Ask git what it sees right now:
git status - 4Stage README.md for the next snapshot:
git add README.md - 5Take the snapshot:
git commit -m "first commit"
chapter 1 of 70%
— bash — worktree sandbox —
worktree — a hands-on git manual
A safe sandbox. Type real git commands; nothing here touches a real repository.
New here? Follow the ▸ step in the panel on the left. Type help for every command.
~/project $
No commits yet.
Try: git init → echo "hi" > readme.md → git add . → git commit -m "first"
HEAD · you are here
no repository yet — git init