Git: version control from scratch

Updated July 31, 2026

Git is a time machine for your project. It records the state of your files at the moments you ask it to, and it lets you go back to any of them. You no longer need the folder full of report_final_v2_really_last.docx: the history lives inside the project itself, and it shows what changed, when, and why. This book takes you from an empty directory to your own repository on GitHub.

Who this is for. You may never have opened a terminal. The book assumes no programming experience: git is for anyone who works with files that change. Code, server configs, articles, page layouts, thesis drafts - git treats them all the same.

What you need. Any computer: Linux, macOS, or Windows. Git installed - we do that in chapter 2, with a path for each of the three systems. Any text editor, even the built-in Notepad. Nothing paid and nothing in the cloud to get started; GitHub only shows up in chapter 6, and a free account there is enough.

How to read this. Chapters go in order, each builds on the one before. The first three give you a working cycle: create a repository, save a change, look at the history. That alone is enough to stop worrying about your files. Branches and working with other people come after. Inside the chapters you will find "How it works" boxes, a second layer for anyone curious about what happens under the hood; you can skip them and come back later. Every chapter ends with exercises and a short summary.

Conventions. A $ at the start of a line is the shell prompt. You do not type it. The output of a command comes right below it, without a prompt:

$ git status
On branch main
nothing to commit, working tree clean

Git's messages appear here exactly as git prints them, in English: that is how you will see them on your own screen. The text next to them explains what each one means.

The book ends with a project that runs through everything. You will create your own repository on GitHub and take it the whole way: from git init in an empty directory to a pull request someone can merge. By then every command in the book will be familiar, and the project ties them into a single workflow.