Imagine writing a long document and hitting save over the same file every time you make a change. If you accidentally delete several pages, or if you want to see what the document looked like three weeks ago, or if a colleague overwrites your work while you are both editing at the same time - you have no recourse. The history is gone.
This is how software was once developed. Version control is the practice and tooling that solved this problem, and it is now so fundamental to professional software development that a developer who does not use version control is effectively not practicing the craft.
Yet version control matters far beyond individual developers working alone. Collaboration has its foundation in it, software history has an audit trail through it, experimentation becomes safe with it as a safety net and modern deployment practices have the infrastructure that it gives.
According to the 2023 Stack Overflow Developer Survey (the largest annual survey of software professionals, covering over 90,000 respondents) 93.9 percent of professional developers use Git as their version control system.
Not only professional convention but genuine utility drives this near-universal adoption and version control is one of the clearest examples in technology of a tool that became indispensable by solving real, widespread problems.
What Version Control Is
Version control (also called source control or revision control) is a system for tracking changes to files over time. Every change (what changed, when, by whom, and why) is recorded. Any previous state of the codebase can be retrieved. Multiple people can work on the same codebase without destroying each other's work.
Modern version control systems also enable branching: creating separate lines of development that diverge from a common starting point and can later be merged back together.
This makes it possible to work on a new feature without disrupting the stable codebase, or to fix a bug in production code without disturbing in-progress development work.
What Version Control Enables
- History: See the complete timeline of every change ever made to the codebase
- Rollback: Revert any file or the entire codebase to any previous state
- Collaboration: Multiple developers working on the same codebase without destructive conflicts
- Branching: Parallel lines of development for features, bug fixes, and experiments
- Attribution: Know who changed what and when
- Context: Commit messages explain why changes were made, not just what changed
- Code review: Review changes before they are incorporated into the main codebase
- Continuous integration: Automated testing triggered by code changes
- Audit trail: Compliance and security audits that require knowing what changed when, and who authorized it
A Brief History: From RCS to Git
The history of version control follows the broader evolution of software development practices.
RCS (Revision Control System), developed by Walter Tichy at Purdue University in the early 1980s, tracked changes to individual files locally - useful for a single developer but inadequate for team work.
RCS brought in the idea of storing deltas (differences) instead of full file copies and that efficiency innovation went on to influence all systems that came after.
CVS (Concurrent Versions System), first released in 1986 by Dick Grune as shell scripts (later rewritten in C by Brian Berliner in 1989), was the first widely used system that allowed multiple developers to work on the same code simultaneously, though its merge and branching capabilities were limited and fragile.
Open-source development through the 1990s made CVS the dominant tool and the Linux kernel was run with patches and tarballs until it took up BitKeeper around 2002.
SVN (Apache Subversion), released in 2000, improved significantly on CVS with atomic commits, better branching, and improved performance. Collabnet originally developed it specifically to replace CVS; it succeeded, and SVN became the dominant system through the mid-2000s and remains in use in some organizations.
Git, created by Linus Torvalds in 2005, represented a fundamental rethinking of version control architecture. Torvalds wrote Git to replace BitKeeper (a proprietary system the Linux kernel project had been using) after BitKeeper revoked its free license.
His stated goal was a system that was "the opposite in every way of CVS." Git is distributed rather than centralized, meaning every developer has a complete copy of the entire repository history on their own machine.
Git's branching model is dramatically faster and more flexible than previous systems. It is now the overwhelmingly dominant version control system in professional software development.
How Git Works
Understanding Git requires understanding a handful of core concepts.
The Repository
A repository (or repo) is the container for all the code, history, and metadata of a project. Every repository contains the full history of every change ever made.
With Git's distributed architecture, every developer has a complete local copy of the repository. There is no single "master" copy on a server - the repository on the server is architecturally identical to the one on any developer's laptop.
The server version is treated as authoritative by convention, not by technical requirement.
New Git users often miss the practical consequence of this design. That is that most Git operations including viewing history, creating branches and committing code as well as computing diffs run entirely locally and need no network access. Speed beats centralized systems by a large margin.
Commits
A commit is a snapshot of the codebase at a specific point in time. Each commit records:
- The changes made to files
- The author of the changes
- The timestamp
- A commit message describing why the change was made
- A unique identifier (a SHA-1 hash)
- A reference to the parent commit(s) it follows
Commits are immutable - once created, they cannot be modified (only replaced by new commits). The chain of commits forms the history of the project.
A good commit message is one of the most undervalued practices in software development. Future developers, including your future self, will read commit messages to understand why code was written the way it was.
The format that has become standard in many organizations: a 50-character or fewer summary line, a blank line, then a more detailed explanation of the why.
Chris Beams's widely read essay "How to Write a Git Commit Message" (2014) articulated seven rules that have become informal industry standards, including: use the imperative mood ("Fix bug" not "Fixed bug"), limit the subject line to 50 characters, and explain the problem being solved rather than describing what the code does.[3]
Branches
A branch is a lightweight, movable pointer to a commit. Creating a branch creates a new line of development that starts from the current commit and can diverge independently.
In Git, branching is extremely cheap - creating a branch takes milliseconds regardless of repository size, because a branch is just a pointer (a file containing a SHA-1 hash).
This makes it practical to create a branch for every feature, bug fix, or experiment, and to discard branches that don't pan out without any consequence to the main codebase.
The default branch is typically named main (formerly master). Best practice is to keep this branch always in a working, deployable state.
Merging and Rebasing
When work on a branch is complete, it needs to be integrated back into the main branch. Git provides two primary approaches:
Merging brings together the histories of two branches to make a new "merge commit" with two parent commits. That keeps the full record of how the branches have split.
Rebasing. When commits from one branch are replayed onto another, new commits with the same changes but different parent histories get created. The result is a linear history but commit hashes get rewritten. That can cause problems when work has been shared with others.
Both approaches have legitimate uses and tradeoffs; teams typically standardize on one for consistency.
The Staging Area
Git includes a concept that distinguishes it from many other systems: the staging area (also called the index). Before creating a commit, changes are staged - explicitly added to the collection that will form the next commit.
This allows developers to group related changes into a single coherent commit even when those changes were made over time.
| Git Concept | What It Does | Analogy |
|---|---|---|
| Repository | Contains all code and history | Project folder with full time machine |
| Commit | Snapshot of codebase at a moment | Save point with description |
| Branch | Independent line of development | Parallel timeline |
| Merge | Combine two branch histories | Converge two timelines |
| Rebase | Replay commits onto a new base | Rewrite history linearly |
| Remote | Copy of repo on another machine or server | Shared copy |
| Pull | Fetch changes from remote and merge | Sync incoming changes |
| Push | Send local commits to remote | Sync outgoing changes |
| Clone | Copy entire repository | Duplicate with full history |
| Stash | Temporarily shelve uncommitted changes | Set aside without committing |
Centralized vs. Distributed Version Control
The fundamental architectural difference in modern version control is between centralized and distributed systems.
Centralized systems (CVS, SVN) have a single authoritative server. Developers check out working copies, make changes, and commit to the central server. There is one history. Every operation that involves history (commits, logs, diffs) requires network access.
Distributed systems (Git, Mercurial) give every developer a complete local copy of the entire repository. Developers can commit, branch, view history, and create tags entirely offline. Synchronization with shared repositories happens explicitly through push and pull operations.
The distributed model has several advantages:
- Works offline and performs faster for history operations
- More resilient - there is no single point of failure
- More flexible branching and merging
- Multiple remote repositories possible (fork model)
Git's distributed architecture also enabled the pull request model that has become central to collaborative software development: a developer pushes their branch to a shared repository and requests that their changes be reviewed and merged, enabling structured code review before changes reach the main branch.
"In open source development, the pull request workflow transformed how thousands of contributors could safely collaborate on the same codebase - without any central gatekeeper beyond code review itself."
Widely attributed to the Git/GitHub era of open source development
GitHub, GitLab, and Bitbucket
Git itself is open-source command-line software. Major platforms built on top of it (GitHub, GitLab and Bitbucket) add web interfaces, collaboration tools as well as integrated development workflows.
GitHub is the dominant platform that hosts most open-source software and a large share of professional development work. Microsoft bought it in 2018 for $7.5 billion. In 2023, GitHub was hosting over 420 million repositories and more than 100 million developers.
Collaborative development has made GitHub's pull request workflow and issues system the standard model across the board.
GitLab focuses mainly on the enterprise market by giving a more complete DevOps platform in a single product that includes CI/CD pipelines, issue tracking as well as project management.
GitLab offers a self-hosted option that some organizations prefer for data sovereignty reasons - particularly common in regulated industries (financial services, healthcare) and in countries with data localization requirements.
In GitLab's 2023 Global DevSecOps Survey, 57 percent of its enterprise customers pointed to self-hosting capability as a major factor in their decision.
Bitbucket (owned by Atlassian) integrates tightly with Jira and other Atlassian products, making it popular in organizations already using the Atlassian ecosystem.
Bitbucket's close Jira integration allows automatic linking of commits to tickets. This creates an audit trail that ties code changes to the requirements and decisions that brought them about.
Features and pricing vary across the platforms but they all put the same underlying Git concepts into practice. What is learned on one platform transfers easily to the others.
Git Workflow Strategies
How teams use Git matters as much as the fact that they use it. Several workflow strategies have emerged as standards.
GitFlow
Developed by Vincent Driessen in 2010, GitFlow is a branching model using multiple long-lived branch types:[4]
main: Production-ready code onlydevelop: Integration branch for completed featuresfeature/*: Individual feature developmentrelease/*: Release preparationhotfix/*: Emergency production fixes
GitFlow works well for teams doing infrequent, batched releases with explicit version numbers. It is common in organizations with formal release management processes.
GitFlow is criticized for its complexity, which can slow down development. There are many branches to manage, complex merge sequences and a develop branch that can become a bottleneck.
In a 2020 addendum to the original article, Driessen himself pointed out that GitFlow is "not the right workflow for all teams". He said simpler workflows may suit teams that practice continuous delivery better.
GitHub Flow
A simpler alternative: there is one main branch that is always deployable, and all new work happens on short-lived feature branches that are merged directly to main via pull requests. This works well for teams deploying continuously.
Trunk-Based Development
Trunk-based development is the practice of all developers committing to a single main branch (the "trunk") continuously - multiple times per day - rather than working on long-lived branches. Features that are not ready to expose are hidden behind feature flags: configuration that controls whether users see a feature.
The DevOps Research and Assessment (DORA) program has done research that appears in the annual State of DevOps reports (2019, 2021, 2022). It has time after time identified trunk-based development as a practice that goes with high-performing development teams.
Based on the 2019 DORA report, elite performers deploy 208 times more frequently and recover 2,604 times faster from incidents than low performers do. The result is that it drives continuous integration, simplifies merge complexity and makes continuous deployment possible.
The tradeoff is that teams need strong automated tests and discipline with feature flags to keep things stable when everybody commits to the same branch at once.
| Workflow | Best For | Branch Lifespan | Deployment Cadence |
|---|---|---|---|
| GitFlow | Versioned releases, many parallel features | Weeks-months | Periodic |
| GitHub Flow | Teams deploying frequently | Days | Frequent |
| Trunk-Based Development | High-frequency deployment teams | Hours | Continuous |
| Release Branching | Products with long support windows | Months-years | Per-version |
Version Control Beyond Code
Version control principles apply to any text-based files that change over time.
Infrastructure as Code
The practice of defining servers, networks, and cloud resources in code (Terraform, AWS CloudFormation, Pulumi) means that infrastructure configuration is stored in version-controlled repositories.
Changes to infrastructure go through the same review and history processes as application code - a significant improvement over manually configured servers with no change history.
Documentation
Documentation written in plain text formats (Markdown, AsciiDoc) can be version controlled alongside the code it describes. This keeps documentation synchronized with code changes and provides the same rollback and collaboration benefits.
The practice of treating documentation as code (subject to the same review and history tracking) has grown significantly with the rise of developer portal platforms like Backstage and documentation-as-code tools.
Data Pipelines and Analysis
More and more, data science and analytics workflows apply version control to data transformation scripts, model configurations and analysis notebooks. Reproducibility brings the same value in data analysis as it does in software development, the benefit of knowing exactly what code made what results.
DVC (Data Version Control) and tools like it take Git concepts to large data files and machine learning models and let teams version not only the code but also the data and artifacts that make a given result. Regulated industries where model reproducibility is a compliance requirement find this growing more important.
Configuration Files
Keeping application configuration in version control gives an audit trail of configuration changes. That is useful for debugging production problems and tracking how the system has evolved.
The practice of GitOps (using Git pull requests as the mechanism for triggering deployment and configuration changes) takes this further, making the Git repository the single source of truth for system state.
Common Version Control Mistakes and How to Avoid Them
Learning version control is straightforward; using it well is a professional skill that takes time to develop. Several common mistakes trip up developers at all levels.
Committing Too Infrequently
The instinct to commit only when something is "complete" produces large, hard-to-understand commits that are difficult to review, impossible to bisect when debugging, and painful to revert if something goes wrong. Commits should be small, logical units of change.
A useful rule: if the commit message requires "and" to describe what changed, the commit should probably be two commits.
git bisect - Git's binary search tool for finding which commit introduced a bug - works dramatically better with many small commits than with a few large ones.
A bisect through 30 small commits narrows to the culprit in 5 steps; a bisect through 5 large commits finds the right commit but still requires understanding thousands of lines of changes to find the specific problem.
Poor Commit Messages
Future developers trying to grasp a codebase's history find "fixed stuff," "WIP" and "misc changes" useless. Good commit messages have a brief first line that says what changed and a body (when needed) that explains why.
The why is the most valuable part: the code shows what changed; the message explains the reasoning that future developers need to evaluate whether the change is still appropriate.
Committing Secrets to Version Control
API keys, passwords, database credentials, and other secrets accidentally committed to a repository - especially a public one - are a serious security incident. Once committed, a secret exists in the repository history even after deletion from the current code.
The correct response is to treat the secret as compromised and rotate it immediately. The best prevention is using environment variables and .gitignore to keep secrets out of version control entirely.
Over 10 million secrets were exposed in public GitHub commits in 2022 and that is a 67 percent year-over-year increase. Google API keys, AWS keys and database connection strings were the most common secrets GitGuardian's 2023 "State of Secrets Sprawl" report found.
Tools like git-secrets, truffleHog, and built-in GitHub secret scanning help detect and prevent this class of error.
Force-Pushing to Shared Branches
When other developers are working from the same branch, rewriting history brings big problems. Their local histories drift from what is remote and merge conflicts grow more numerous and team trust weakens. Force-pushing should go only on personal branches and needs to be handled with caution even then.
On most platforms, branch protection rules that stop force-pushing to major branches (main, develop and release branches) can be set up. Turning on these protections is standard security and collaboration practice.
Avoiding Branches for Fear of Complexity
Some developers, particularly those new to Git, work directly on the main branch because branching feels complex. This fear has less basis in Git than it did in older version control systems - in Git, branching is cheap and fast.
Without branches, work loses the ability to isolate work-in-progress from the stable codebase, code review becomes harder and switching between tasks without losing work gets eliminated.
The Security Dimension of Version Control
There is growing discussion of version control systems in the software supply chain security conversation. Several major incidents have shown what the risks are.
The SolarWinds attack (2020). Attackers got into the build pipeline that turns source code into software. The attack was complex in part because version control and build systems are trusted by default and code that makes it through version control with the right approvals looks legitimate.
Dependency confusion attacks (documented by Alex Birsan in 2021) exploit the way package managers resolve dependencies from public registries, but understanding and auditing these risks requires inspecting package.json, requirements.txt, and similar files in version-controlled repositories.
Malicious commits to open-source repositories, such as the 2024 XZ Utils backdoor that came in via a long-running social engineering campaign against a project maintainer, have made people see that version control history must be treated not just as a development tool but as a security artifact.
Good practice here includes requiring signed commits (GPG signatures that verify the author's identity), turning on commit verification rules on key branches, auditing repository access controls regularly and using CODEOWNERS files. Changes to sensitive files need approval from specific people.
Why Version Control Matters for Non-Developers
If you work in technology but do not write code, understanding version control is valuable for several reasons:
It shapes how software is built. Discussions of release timelines, feature flags, code reviews and deployment processes are all based on version control concepts.
Incident investigation. Engineers most often turn to version control history first when something breaks in production. Recent commits answer the question of what changed.
Project understanding. In a way that the current codebase by itself does not, the commit history of a project gives the story of how the project developed.
Documentation practices. The version-control-everything mindset that engineers apply to code is increasingly applied to documentation, configuration, and even business logic.
Compliance and audit. Regulated industries require evidence of who approved changes, what was changed, and when. Version control provides this audit trail naturally.
Getting Started
For developers not yet using version control systematically, the starting point is simple:
- Install Git (git-scm.com)
- Learn the essential commands:
git init,git add,git commit,git push,git pull,git branch,git merge,git log - Create an account on GitHub or GitLab
- Apply version control to every project, even personal ones
- Practice branching: create a branch for every new feature or bug fix, even when working alone
There is a real overhead from version control but it comes up front. Committing work becomes habit quickly as does writing clear commit messages and working in branches. The cost of not using version control (work lost, inability to grasp change history and collaboration chaos) is paid constantly.
Summary
By systematically recording the history of changes to files and allowing rollback, collaboration and audit, version control keeps track of what happens to files over time. Professional software development now uses Git as the nearly universal tool for this practice. About 94 percent of professional developers surveyed use it.
Understanding it requires understanding repositories, commits, branches, and merge strategies.
Past the mechanics, version control is a professional discipline. It means treating code as valuable enough to track with care, writing down the reasoning behind changes and building software so future developers can understand and maintain it.
The best time to start using version control was the first day you wrote code. The second best time is now.
Sources and Further Reading
- Chacon, S., & Straub, B. Pro Git (2nd ed.). Apress. View source
- Stack Overflow. (2023). 2023 Developer Survey.
- Beams, C. (2014). How to Write a Git Commit Message.
- Driessen, V. (2010). A successful Git branching model.








