Every project changes. Files are added, edited, renamed, and deleted, often by several people at once, and sooner or later someone needs to know what changed, when, why, and how to get the old version back. Version control is the tool that answers those questions. This lesson explains what version control does, how Git's distributed design works, and why Git, the tool on your computer, is not the same thing as GitHub, GitLab, or any other website that hosts Git repositories.
Before you start
You need no Git experience. It helps to be comfortable opening a terminal and running a command, and to have worked on a project with more than a handful of files. Lesson 2 covers installation; this lesson is about the ideas.
What version control does
A version control system (VCS) records changes to a set of files over time, so you can:
- See history: every recorded change, who made it, when, and the message explaining why.
- Go back: restore a file, or the whole project, to any recorded state.
- Work in parallel: develop a feature on its own line of work without disturbing the stable version, then combine the two.
- Collaborate: several people change the same project and merge their work, with tools to handle overlapping edits.
- Understand bugs: find the exact change that introduced a problem by comparing versions.
Without version control, people improvise: folders named final, final-v2, and final-really-final, or zip files emailed back and forth. These approaches lose information (who changed what, and why) and make combining two people's work a manual, error-prone job.
Centralized and distributed version control
Version control systems come in two broad designs.
In a centralized system, such as Subversion (SVN) or the older CVS, there is one central server holding the full history. Developers check out a working copy, and most operations (viewing history, committing) talk to that server. If the server is unreachable, you can still edit files, but you can't commit or browse history.
In a distributed system, such as Git or Mercurial, every copy of the repository is a full repository: the complete history lives on each developer's machine. You commit, branch, view history, and compare versions locally, without a network. Sharing happens by exchanging commits between repositories, usually through one that the team agrees to treat as the main copy.
Distributed version control has practical consequences:
- Speed: most operations are local file reads, so they're fast.
- Offline work: you can commit on a plane and share later.
- Resilience: every clone is a backup of the full history.
- Flexible workflows: there's no technical "center"; the central repository is a convention, not a requirement.
A short history of Git
Git was created in 2005 by Linus Torvalds for developing the Linux kernel, after the proprietary tool the kernel had been using stopped being available to it free of charge. The design goals were speed, a simple data model, strong support for many parallel branches, and the ability to handle a project the size of the kernel. Junio Hamano has maintained Git since shortly after its creation. Today it's the most widely used version control system in software development, and it's free, open-source software.
How Git thinks about your project
Many older systems store a file's history as a list of changes (diffs). Git thinks in snapshots. Each time you record a change, called a commit, Git stores a picture of what all your tracked files look like at that moment. For files that didn't change, it reuses what it already stored, so snapshots are cheap.
Each commit also records:
- the author and the time;
- a message describing the change;
- a pointer to the commit (or commits) before it, its parent.
Following parent pointers back from any commit gives you the project's history. Git identifies every commit by a hash of its contents, a long hexadecimal ID such as c7a0a9b…. Change anything in a commit, even one character of the message, and you get a different ID. That makes history tamper-evident: you can't quietly alter an old commit without every later ID changing too. Lesson 13 looks at how this works inside Git.
The three places your work lives
When you use Git, a file moves between three areas:
- The working tree: the files you see and edit in your project folder.
- The staging area (also called the index): the set of changes you've marked to include in the next commit.
- The repository: the committed history, stored in a hidden
.gitfolder.
The staging area surprises newcomers, but it's useful: it lets you commit part of your work, for example a bug fix, while leaving unrelated edits for a separate commit. Lesson 3 practices this.
Git is not GitHub
This is the most common confusion for beginners, and worth getting right from the start.
Git is a program. It runs on your computer, stores history in the .git folder, and works entirely without the internet.
Repository hosting platforms are services that store Git repositories on a server and add collaboration features around them: web browsing of code, pull or merge requests, code review, issue tracking, permissions, and automation (CI/CD). Common examples:
- GitHub, owned by Microsoft, the largest hosting service and the home of many open-source projects.
- GitLab, available as a hosted service and as software you can run yourself, with built-in CI/CD.
- Bitbucket, from Atlassian, often used alongside Jira.
- Azure Repos, part of Microsoft's Azure DevOps.
- Gitea and Forgejo, lightweight forges you can host yourself. Codeberg is a non-profit hosting service run on Forgejo.
- SourceHut, a minimalist platform built around email-based collaboration.
All of them store ordinary Git repositories. The commits on your laptop are the same whichever platform you push them to, which is why you can move a repository between platforms (lesson 15). What differs is everything around the repository: review workflows, permissions, automation syntax, issue trackers, and pricing. Lesson 6 compares them.
Keeping this distinction clear helps you in three ways. You learn skills that work everywhere, not one website's buttons. You understand which problems are Git problems (a merge conflict) and which are platform problems (a permission setting). And you keep the freedom to change platforms.
What a repository contains
A Git repository is just a folder with a .git subfolder:
my-project/
├── .git/ # Git's database: commits, branches, configuration
├── README.md # your files: the working tree
└── src/
└── main.tsDelete the .git folder and the project becomes ordinary files with no history. Copy the whole folder, .git included, and you've copied the entire repository with its history.
What Git doesn't do
Git is excellent at tracking text files such as source code, configuration, and documentation. It's less suited to some things:
- Large binary files such as videos or design files: every version is stored in full, so repositories grow quickly. Git LFS helps (lesson 14).
- Secrets: anything committed stays in history, even after you delete it in a later commit. Never commit passwords or API keys (lesson 12).
- Backups of everything: Git tracks what you tell it to. Generated files, dependencies, and local settings are usually excluded on purpose with
.gitignore.
Common mistakes and troubleshooting
- Thinking you need an account to use Git. You don't. Git works locally; accounts belong to hosting platforms.
- Treating the hosting platform as the only copy. Your local clone holds the full history too, but only what you've fetched; keep it updated.
- Expecting Git to save automatically. Git records only when you commit. Uncommitted edits can be lost.
- Committing everything in one giant commit. Small, focused commits with clear messages make history useful.
- Committing secrets "temporarily". Removing them later doesn't erase them from history.
If someone says "push it to Git" and means "upload it to GitHub," translate in your head: Git records history locally; pushing sends commits to a remote repository that might be on any platform.
Practical exercise: map your version control
Answer these for a project you work on (or plan to):
- Which files change most often, and who changes them?
- How do you currently go back to an older version of a file?
- How would two people edit the same file at the same time today?
- Which files should never be tracked (secrets, dependencies, build output)?
- Which hosting platform does your team or community use, and which features do you rely on that belong to the platform rather than to Git?
Keep the answers. Lesson 3 turns question 4 into a .gitignore file.
Key takeaways
- Version control records history, lets you go back, and lets people work in parallel and combine their work.
- Git is distributed: every clone holds the full history, and most operations are local.
- Git stores snapshots, identified by hashes, which makes history tamper-evident.
- Your work moves between the working tree, the staging area, and the repository.
- Git is the tool; GitHub, GitLab, Bitbucket, Azure Repos, Gitea, Forgejo, Codeberg, and SourceHut are platforms that host Git repositories.
References
- Pro Git, chapter 1: Getting Started (opens in a new tab)
- Pro Git: What is Git? (opens in a new tab)
- Git documentation (opens in a new tab)
- Codeberg: What is Codeberg? (opens in a new tab)
- Forgejo (opens in a new tab)
What's next
Next, Getting Started with Git: Installation, Setup, and Your First Repository installs Git on Windows, macOS, or Linux, configures it, and creates your first repository.

