What Git is
Git is a tool that keeps the full history of your code, so you can see every change ever made and go back to any earlier version.
Without it, people end up with folders like project-final, project-final-2 and project-final-REALLY. Git replaces all of that. Every time you save a snapshot (called a commit), Git remembers exactly what every file looked like at that moment, who changed it and why. It also lets several people work on the same code at the same time and combine their work safely. Almost every software team in the world uses it, and GitHub is the most popular website for sharing code stored with Git.
Most people only learn three commands: add, commit and push. This course explains what Git is actually doing underneath, because once you can picture that, the confusing parts of Git stop being confusing.
What you’ll be able to do
By the end you will be able to:
- save snapshots of your work and write messages that explain them;
- work on a new idea in a separate branch without breaking the main code;
- combine your work with other people’s, and sort out the clashes when two people changed the same lines;
- find out who changed a line, when, and why;
- undo almost any mistake, including ones that look permanent;
- work the way real teams do: pull requests, code review and automatic checks on GitHub.
Where to start
The notes build on each other, so read them in order. Notes 01–11 are Git on your own computer; 12–15 are Git with a team; 16–17 are tools you’ll only need now and then.
One rule to know before anything else: never rewrite history that someone else may already have downloaded. Almost every other mistake in Git can be undone, but that one breaks other people’s copies and you can’t fix it for them.
The basics
- How Git Actually Works: what Git stores when you commit, and what’s inside the hidden
.gitfolder. It feels like theory, but it makes everything after it easier. - Configuration and Setup: installing and setting up Git, and starting or copying a project.
- The Three Trees: the three places your files live (your folder, the staging area, and the last commit), and how files move between them.
- Branching: making a separate line of work, switching between branches, and getting unstuck.
Combining work
- Merging: joining two branches back together, and fixing the clashes when both changed the same lines.
- Rebasing: another way to combine branches, by moving your commits on top of someone else’s. Also tidying up your commits before sharing them.
- Merge vs Rebase: when to use which, with a simple decision chart.
- Remotes and Collaboration: sending your work to GitHub and getting other people’s work back.
Looking back and fixing mistakes
- Investigating History: searching the history, seeing what changed, finding who wrote a line, and tracking down which commit broke something.
- Undoing Things: the different ways to undo, and which one you want. Starts with a decision chart, because this is where most Git panic happens.
- Tags and Versioning: marking a commit as a release, like “version 1.2.0”, and what the numbers mean.
Working with a team
- Conventions and Hygiene: writing commit messages people can read, and keeping a project tidy.
- Branching Strategies: the common ways teams organise their branches, and naming them.
- GitHub as a Platform, and Git in CI: pull requests, protecting the main branch, code owners, and automatic checks that run on every change.
- The GitHub CLI (`gh`): doing everything from note 14 from the terminal instead of the website.
Occasional tools
- Power Tools: a project inside a project, several branches checked out at once, and copying single commits between branches.
- Hooks and Signing: running checks automatically before each commit, and proving a commit really came from you.
For quick lookup
- Git command reference: the commands, grouped by what you’re trying to do. For looking things up, not reading through.
- Git troubleshooting: fixes for when something has gone wrong, such as “I committed to the wrong branch” or “I committed my passwords file”. Written for the moment you’re panicking.
Practice
- Projects: hands-on tasks, from easy (🟢) to hard (🔴), each with a clear “done when”.
- The best practice is real use. Type every Git command yourself in your own projects instead of letting a tool do it for you. The Gees Arise and SocioBoom logs show what that looked like on real projects, mistakes included.
Key ideas to remember
- A commit is a snapshot of every file, not a list of changes. Git works out the changes when you ask for them. → 01
- A branch is just a label pointing at a commit. Making one is instant and costs nothing, so make them freely. → 04
- Most “lost” work isn’t lost. Git keeps a log of where you’ve been for about 30 days, so you can usually get commits back. → 10
- Never rewrite history others have downloaded. Rebase your own unshared work freely; merge shared work. → 07
- Fix a merge clash by reading both sides, not by picking one and hoping. → 05
Related
- Programming Fundamentals: start Git on your first project, not your fifth.
- Software Engineering: how teams work together around code.
- DevOps: what happens to your code after it leaves Git: testing, building and shipping it.
About this course
- Size: 17 notes, about 17,000 words, plus a command reference and a troubleshooting guide. Split in August 2026 out of one very long reference file.
- Not covered yet: how Git compresses and maintains its storage; tools for very large repositories (sparse checkout, partial clone, rewriting a repository’s history with
git filter-repo); GitLab and Bitbucket, which are only mentioned in passing.
Software engineering
Infrastructure & security
Computer science
Hardware & engineering