Topics Version control

What is version control?


Version control - also known as source control or revision control - is an important software development practice for tracking and managing changes made to code and other files. It is closely related to source code management.

Learn how to streamline development

The basics of version control

With version control, every change made to the code base is tracked. This allows software developers to see the entire history of who changed what at any given time — and roll back from the current version to an earlier version if they need to. It also creates a single source of truth.

Version control (or source control or revision control) serves as a safety net to protect the source code from irreparable harm, giving the development team the freedom to experiment without fear of causing damage or creating code conflicts.

If developers code concurrently and create incompatible changes, version control identifies the problem areas so that team members can quickly revert changes to a previous version, compare changes, or identify who committed the problem code through the revision history. With a version control system (VCS), a software team can solve an issue before progressing further into a project. Through code reviews, software teams can analyze earlier versions to understand the changes made to the code over time.

Depending on a team's specific needs and development process, a VCS can be local, centralized, or distributed. A local VCS stores source files within a local system, a centralized VCS stores changes in a single server, and a distributed VCS involves cloning a Git repository.

Learn five ways to enhance team collaboration with version control best practices →

Version control enables teams to collaborate and streamline development to resolve conflicts and create a centralized location for code.

Why use version control?

As organizations accelerate delivery of their software solutions through DevOps, controlling and managing different versions of application artifacts — from code to configuration and from design to deployment — becomes increasingly difficult.

Version control software facilitates coordination, sharing, and collaboration across the entire software development team. It enables teams to work in distributed and asynchronous environments, manage changes and versions of code and artifacts, and resolve merge conflicts and related anomalies.

Read how Git Partial Clone lets you fetch only the large files you need →

version-control

What is a version control system?

A version control system (VCS) tracks changes to a file or set of files over time. The most common type is a centralized VCS, which uses a server to store all the versions of a file. Developers can check out a file from the server, make changes, and check the file back in. The server then stores the new version of the file.

Types of version control systems

The two most popular types of version or revision control systems are centralized and distributed. Centralized version control systems store all the files in a central repository, while distributed version control systems store files across multiple repositories. Other less common types include lock-based and optimistic.

Distributed

A distributed version control system (DVCS) allows users to access a repository from multiple locations. DVCSs are often used by developers who need to work on projects from multiple computers or who need to collaborate with other developers remotely.

Centralized

A centralized version control system (CVCS) is a type of VCS where all users are working with the same central repository. This central repository can be located on a server or on a developer's local machine. Centralized version control systems are typically used in software development projects where a team of developers needs to share code and track changes.

Lock-based

A lock-based version control system uses file locking to manage concurrent access to files and resources. File locking prevents two or more users from making conflicting changes to the same file or resource.

Optimistic

In an optimistic version control system, every user has their own private workspace. When they want to share their changes with the rest of the team, they submit a request to the server. The server then looks at all the changes and determines which ones can be safely merged together.

Benefits of version control

Quality

Teams can review, comment, and improve each other's code and assets.

Acceleration

Branch code, make changes, and merge commits faster.

Visibility

Understand and spark team collaboration to foster greater release build and release patterns. Better visibility improves everything from project management to code quality.

What are the main version control systems?

The three most well-known version control tools (also known as revision control systems) are Git, Subversion, and Mercurial.

Git

Git is the most popular option and has become synonymous with "source code management." Git is an open source distributed system that is used for software projects of any size, making it a popular option for startups, enterprise, and everything in between.

Subversion (SVN)

SVN is a widely adopted centralized VCS. This system keeps all of a project's files on a single codeline making it impossible to branch, so it's easy to scale for large projects. It's simple to learn and features folder security measures, so access to subfolders can be restricted.

Mercurial

Mercurial is a distributed VCS that offers simple branching and merging capabilities. The system enables rapid scaling and collaborative development, with an intuitive interface. The flexible command line interface enables users to begin using the system immediately.

How does version control streamline collaboration?

Version control coordinates all changes in a software project, effectively tracking changes to source files, designs, and all digital assets required for a project and related metadata. Without it, projects can easily devolve into a tangled mess of different versions of project files, hindering the ability of any software development team to deliver value.

With a strong VCS, software teams can quickly assemble all critical project files and foster actionable communication to improve code quality. And because it provides a single source of truth, stakeholders from across a DevOps team can collaborate to build innovative solutions — from product managers and designers to developers and operations professionals.

Discover 15 best practices for large teams to innovate and collaborate using source code management →

Take GitLab for a spin

See what your team could do with The DevSecOps Platform.

Get free trial
Headshots of three people

Have a question? We're here to help.

Talk to an Expert