Level 1

Git overview

What a coding project is, how people work on one together, and why they need a system to control the versions.

Welcome to the most intuitive Git tutorial this side of, well, wherever you are. You are about to embark on a journey through sixteen levels of Git concepts, commands and secrets. By the end you will have an in-depth understanding of Git and a real knack for the commands that matter most.

One thing before we start. Git is notoriously abstract, and most people find it hard to picture. So these levels lean on two things: a picture of a scrapbook that stands in for everything Git does, and a live graph of a real repository, drawn by git-sim, that shows exactly what each command did. If you have ever felt intimidated by coding concepts, relax. Gamified things are fun, and you will get to practice everything you learn.

Step 1 of 5
0 xp

A coding project

Git is a tool that helps people work together on coding projects, which are also known as software projects. A coding project is a pile of files and folders that contain code. Some projects have three files. Some have three hundred thousand.

The code can be written in all kinds of programming languages: Python, Java, JavaScript, C, C++, Rust, Go, PHP, the list goes on. Git does not care which one. Whatever language you choose to learn, Git can track your project.

Lots of coders, one project

Lots of different coders often work on the same project, from different computers, sometimes from all around the world. With just one copy of the code, or worse, a copy per person, that gets messy fast.

Who changed line one? When did this break? Which of these five copies is the newest? Coders need a way to make their own changes, share them, and keep track of what changed, when it changed and who changed it.

A system to control the versions

In other words, they need a SYSTEM... to CONTROL... the VERSIONS... of the code. See what happened there? Git is the version control system, or VCS, that most coders use.

Git keeps track of which code files were changed, which lines were edited, who made each change and when. That builds up a full history of your code from day one to today, so you can see how the project changed over time, share code with others, combine everyone's changes, and find out what went wrong when something breaks.

How these levels work

Every level has a picture on the left and a story on the right. Sometimes the picture is the scrapbook: a homemade book where memories get stuck onto pages. It stands in for Git, and each part of it is one Git idea. You will meet those parts one at a time, starting in Level 2.

Sometimes the picture is a graph: a drawing of a real repository, made by a tool called git-sim while the real commands ran. You can drag its slider to watch a command play out, hover things to see what they are, and press Enlarge when you want it bigger.

Above the graph sits a terminal. When a step has a command, you type it there yourself, the way you would on your own computer. Get it right and the graph plays the command from before to after, with the exact output Git printed. Get it wrong and the terminal tells you what is off, as many times as it takes. Now and then a level stops and asks you to choose a command instead: every option is worth trying, because the picture shows what each choice would have done.

Where you are headed

Here is a sneak peek: the repository you will have built by the end of Level 16, drawn by git-sim. Every circle is a change you will make yourself. Every label is a word you will know. Ask Git for the log, its list of every page:

Type this into the terminal below
git log --oneline --graph --all

You do not need to understand any of it yet. Just notice that it is a chain of connected steps with a few labels on it, and that nothing here is a drawing of an idea. It is the real thing, read straight from the repository.

safe 'log' only reads; nothing in the repository changes.
git-sim
Initial CommitDevlands

The graph appears here when the first command runs. The simulations are drawn by git-sim from a real repository.

The scrapbook · one picture for every Git idea

The scrapbook picture appears as the story is told.