Git
The dominant distributed version control system. Tracks snapshots of a project's files and supports lightweight branching.
- Primary domain
- Software Engineering & Notation
- Sub-category
- IDEs & Software Configuration Management
In simple terms
Git is the most-used tool for tracking changes to code. You take snapshots (“commits”), give them messages, group them on branches, and share them with other people through a remote server like GitHub or GitLab.
More detail
Git was created by Linus Torvalds in 2005 to coordinate development of the Linux kernel. Its key ideas:
- A repository is a directed graph of commits. Each commit points to the snapshot it captured and to one or more parents.
- Branches are just movable pointers into that graph.
- Every clone has the full history, not just the latest revision.
- Most operations are local and fast.
The day-to-day commands you use most:
| Command | Roughly does |
|---|---|
git clone <url> | Copy a remote repo locally |
git status / git diff | See what is changed |
git add <files> / git commit -m "..." | Stage and record changes |
git push / git pull | Sync with the remote |
git checkout -b <branch> | Make and switch to a new branch |
git merge / git rebase | Combine branches |
Why it matters
Git is the lingua franca of modern software development. Almost any open-source contribution today flows through it.
Real-world examples
-
The Linux kernel.
-
Practically every open-source library on GitHub.
-
This very project.
-
git bisectcan find a regression-introducing commit across thousands of commits in log₂(n) steps — a real-world application of binary search you’ll use as soon as you have one bug.
Common misconceptions
- “
git push --forceis fine.” It is fine on your own branch; it rewrites public history on shared branches and is one of the most reliable ways to upset your teammates. - “
git pullis harmless.”git pullisfetch + merge. It can leave you with merge commits or conflicts you didn’t expect.
Learn next
GitHub, code review, branching strategies (trunk-based development, GitHub flow, etc.).
Read this in a learning path
All paths →This topic is part of 3 learning paths. Start in context to keep prev/next and progress tracking.
- Read this in Backend Engineer Starter KitThe minimum set of topics that turns a programmer into someone who can ship and operate a backend service in production. Start here View the whole path
- Read this in Frontend Engineer Starter KitThe topics that take you from "I can write some JavaScript" to "I can ship a real product on the web that respects users". Start here View the whole path
- Read this in Software Engineering PracticesThe discipline behind writing code that teams can maintain, test, and evolve — from version control to deployment pipelines. Start here View the whole path
Relationships
- Requires
- Leads to
- Required by
Neighborhood
A visual companion to the relationships above. Click any node to visit that topic.