Module 2 · Git: the 20 everyday commands · Lesson 9 of 16
What Git is: save points, three areas, init and status
Why Git exists, the three places your changes live, and your first repository.
In this lesson · about 16 minutes
- Explain what Git does in everyday words
- Name the working folder, the staging area and the repository
- Start a repository with git init and read git status
A folder that Git looks after is called a repository (repo). Git keeps its records in a hidden .git folder inside it. GitHub, GitLab and similar websites are places to keep a copy of a repository online so a team can share it; that online copy is called a remote.
The three areas
- Working folder: the files you see and edit.
- Staging area: a "ready" tray. You choose which changes go into the next save point with
git add. - Repository: the save points themselves, created with
git commit.
Why the middle step? Because you often change five things but want to save them as two separate, well-described commits. Staging lets you pick.
Whiteboard · watch and try
How a change travels through Git
Tip: press Pause, then use the pen to work along on the board. Space plays and pauses; Ctrl+Z undoes your last mark.
Key terms
Say the meaning to yourself, then tap a card to check.
Practice terminal · missions
Start tracking Sam's website
Sam has a website folder but no history yet. The right-hand picture shows Git's three areas once there is a repository.
Missions 0 of 4
- 1Move into the website folder.
- 2Ask Git for the status.
- 3Turn this folder into a repository.
- 4Ask for the status again.
Type a command and press Enter. Try help to list commands. Tab finishes names, ↑ repeats.
No Git repository here yet.
You are in ~. Git pictures appear once you cd into a project that is a repository, or run git init or git clone.
- ~ (/home/sam)you are here
- documents
- notes.txt
- website
- index.html
- README.md
- style.css
Check your understanding0 of 4 correct
Quiz score: 0 of 4
Written by Noviq Academy in its own words. The practice terminal is a simulation that runs in your browser: it imitates Linux (Ubuntu-style output) and Git closely, but it is not a real computer, and real output can differ slightly. The servers, people, web addresses and GitHub addresses in the labs are made up. Linux is a trademark of Linus Torvalds; Git and GitHub belong to their owners. Read-aloud uses your device's built-in voices.