
How Git works
Covers What Git Is and Why, Commits and Version History, Branches and Merging Essentials and more.
1 · What Git Is and Why
“How Git works” is a 8-lesson course at Teen level, created with soclever, a personal AI teacher. Each lesson takes a few minutes and ends with a check-in question; finish the curriculum and you can take a certificate test to earn a diploma. Try the first lesson without an account — or make your own course on any topic. Shared by @meirrosenschein.
What you'll learn
- What Git Is and Why. You're working on a group project, and three people are editing the same document. Person A adds a section on Monday.
- Commits and Version History. You're three hours into editing a document when your coworker asks, "What did that paragraph say before you changed it?" You freeze. You don't know. You overwrote it.
- Branches and Merging Essentials. Your team is building a website. One person needs to redesign the homepage while another fixes bugs in the checkout process.
- Git's DAG and Object Model. You save a file called essay.txt. Git doesn't store the file itself—it stores a snapshot of what's inside it.
Lesson 1: What Git Is and Why
You're working on a group project, and three people are editing the same document. Person A adds a section on Monday. Person B deletes a paragraph on Tuesday, not realizing Person A just wrote it. Person C rewrites the introduction on Wednesday, overwriting changes from both of them. By Friday, nobody knows what actually happened, who changed what, or how to get back to a working version. This is the problem Git solves.
Git is a version control system—software that records every change made to your files and keeps a complete history. Think of it like a detailed log book for your code. Instead of having one messy file that everyone overwrites, Git lets each person make changes on their own, then carefully merges those changes together. Every change gets a timestamp, a description of what changed, and who made it.
Let's walk through a simple example. You're writing a website and commit the HTML file (tell Git to save a version). Git takes a snapshot of that file and stores it. The next day you fix a typo and commit again. Git doesn't throw away the old version—it keeps a snapshot of each one and can show you exactly what changed between version one and version two. A week later you add a new feature. Git now knows all three states of your file and can show you exactly what was different in each step. If the new feature breaks something, you can jump back to any earlier version instantly.
Here's why that matters for teams: when your teammates make changes at the same time, Git can usually merge them automatically, because it's tracking which lines changed, not just replacing the whole file. If two people edit different parts of the code, Git combines both edits. If they edit the same line, Git flags it so you can decide which version to keep.
Questions this course answers
What is Git?
Git is a version control system software that records every change made to your files and keeps a complete history.
What is a commit?
A commit is a snapshot, which is a frozen photograph of every file in your project at one exact moment.
How do Git branches work?
Git branches let each person work on a separate copy of the code at the same time by creating a parallel timeline.
What does Git store when you save a file?
Git does not store the file itself, but instead stores a snapshot of what is inside it.
More courses to explore
- How Bitcoin works — 4 lessons (Teen level).
- Understanding How the United Nations Works — 4 lessons (Conversation level).
- Entourage — 4 lessons (Teen level).
- Read Your Own Medical Test Results — 4 lessons (Beginner).