What is Git?
Git is a free and open-source distributed version control system (DVCS). In plain English, Git is software that tracks every change you make to your files over time, stores a complete history of those changes, and lets you go back to any previous state at any moment.
Linus Torvalds created Git in April 2005 after the Linux kernel community lost access to the proprietary BitKeeper tool they had been using. In just ten days, Torvalds wrote the first version of Git — designed to be fast, distributed (no central server required), and capable of handling large projects like the Linux kernel with hundreds of contributors.
Git is a tool you install on your computer. GitHub is a website that hosts Git repositories online. They are related but completely separate. You can use Git without GitHub, and GitHub is just one of many Git hosting platforms. See Git vs GitHub vs GitLab for the full breakdown.
What is Version Control?
Before understanding Git's specifics, it helps to understand what version control means and why it matters. Think of version control as the undo history for your entire project — but far more powerful than Ctrl+Z in a text editor.
Without version control, developers commonly resort to naming files like project_final.js, project_final_v2.js, project_ACTUALLY_final.js. This approach is fragile, error-prone, and completely unworkable with a team. Version control solves all of this:
- History — Every change is recorded with who made it, when, and why.
- Undo — You can revert any file, or your entire project, to any previous state.
- Collaboration — Multiple people can work on the same files simultaneously without overwriting each other's work.
- Branching — You can experiment in isolation, then merge your changes back when ready.
- Backup — Your entire project history is stored, not just the latest version.
With Git, you never need project_v2_FINAL.js again. Your entire change history lives inside the .git folder. You always work on one file — Git tracks every version automatically.
How Git Works
Most older version control systems (like CVS or SVN) track changes as a series of file-based diffs — they record what lines changed in which files. Git takes a fundamentally different approach: it stores snapshots of your entire project at each commit.
When you commit in Git, it takes a picture of every tracked file at that moment and stores a reference to that snapshot. If a file hasn't changed since the last commit, Git doesn't store it again — it just references the previous version. This snapshot model makes branching, merging, and history traversal extremely fast.
Git also operates almost entirely locally. Your entire project history lives on your own machine inside the .git directory. You don't need network access to view history, create branches, or make commits. This makes Git operations feel instantaneous compared to server-dependent systems.
The Three States
Every file in a Git repository lives in one of three states. Understanding this is the most important mental model for new Git users:
| State | Location | Description |
|---|---|---|
| Modified | Working Tree | You have changed the file but not yet told Git about it |
| Staged | Staging Area (Index) | You have marked the modified file to go into the next commit |
| Committed | Repository (.git) | The snapshot is safely stored in your local Git database |
This three-stage process is intentional. The staging area (also called the index) acts as a preparation area — it lets you carefully choose exactly which changes go into the next commit, even if you have modified many files. This control over what you commit is one of Git's most powerful features.
Key Concepts
Before running your first Git command, you should know these six fundamental concepts. Each has its own detailed lesson later in the course.
| Concept | What It Is |
|---|---|
| Repository (repo) | A project folder tracked by Git. Contains all your files plus the hidden .git directory that stores the entire history. |
| Commit | A saved snapshot of your project at a specific point in time. Every commit has a unique SHA-1 hash ID, an author, a timestamp, and a message. |
| Branch | A lightweight, movable pointer to a commit. Branches let you develop features or fix bugs in isolation without affecting the main codebase. |
| Merge | Combining the history of one branch into another. When your feature is done, you merge it back into the main branch. |
| Remote | A version of your repository hosted on a server (like GitHub). You push changes to a remote to share them, and pull to receive others' changes. |
| Clone | Downloading a complete copy of a remote repository — including its entire history — to your local machine. |
Your First Look at Git
Once Git is installed, you can check your version and inspect any repository with just two commands:
# Check which version of Git is installed
git --version
# Inside any Git repository — see what has changed
git status
nothing to commit, working tree clean
The git status command is the most-used command in Git. It tells you which branch you are on, which files are modified, which are staged, and what is ready to commit. You will run it dozens of times per day once you start using Git regularly.
Under the hood, Git is a key-value store. Every piece of content (files, commits, trees) is stored as an object identified by the SHA-1 hash of its content. This is why Git is so reliable — the same content always produces the same hash, making corruption detectable and history tamper-evident.
📋 Summary
- Git is a free, open-source distributed version control system created by Linus Torvalds in 2005 for the Linux kernel.
- Version control is like undo history for your entire project — it tracks every change, who made it, and when.
- Git stores snapshots (not diffs), operates locally, and is extremely fast.
- Every file is in one of three states: modified (working tree), staged (index), or committed (.git repository).
- The six core concepts are: repository, commit, branch, merge, remote, clone.
git --versionchecks your installation;git statusis the most-used daily command.
FAQ
Yes. Git is completely free and open-source software, licensed under the GNU General Public License version 2. It costs nothing to download, install, or use — for personal projects, open-source work, or commercial software development. Git itself is the local tool; cloud platforms like GitHub have free and paid tiers, but those are separate from Git itself.
Git works on any type of file, not just code. Many people use Git to version-control writing projects, configuration files, design assets, research notes, and even legal documents. Git works best with plain text files (where it can show you exactly what lines changed). Binary files like images or Word documents are tracked by Git, but you cannot see a meaningful diff — you just know the file changed.
SVN (Subversion) is a centralised version control system — all history lives on a central server, and you need network access to commit or view history. Git is distributed — every developer has the full project history locally. Git is also significantly faster, has much better branching and merging, and is the current industry standard. SVN is still found in older enterprise codebases but is rarely used for new projects.
Git has a reputation for being complex, but that complexity only surfaces in advanced scenarios (rebasing, resolving merge conflicts, understanding the internals). The everyday workflow — init, add, commit, push, pull — can be learned in an afternoon. The best strategy is to learn the core workflow first, use it daily, and expand your knowledge gradually. This course is structured exactly that way.
No — there are many excellent Git GUI clients: GitHub Desktop, GitKraken, Sourcetree, and IDE integrations in VS Code, JetBrains, and others. However, the command line gives you full access to every Git feature, works on any machine (including servers), and is what all documentation and tutorials reference. Learning the CLI first gives you a deep understanding that makes GUI tools much easier to use.