Version Control

Steven J Zeil

Last modified: Sep 22, 2020
Contents:

Abstract

Version control (a.k.a. version management is concerned with the management of change in the software artifacts being developed.

In this lesson we look at the kind of practical problems that arise during software development and that can be addressed by proper version control.


1 Issues in Version Control

The issues addressed by version control are:

2 Approaches and Tools

2.1 History

VC (Version Control) systems keep code in a repository.

The primary operations of a VC repository are

Each commit results in a new revision (version) of the code:

 

2.1.1 Diffs

Early VC systems made a big deal about only keeping “diffs” of the changes instead of entire copies of the differnet file versions.

 

That probably matters less now, but modern VC systems still like to describe each version in temrs of “diffs” from the prior one.

2.2 Exploration

2.2.1 Branches

 
Suppose that we have worked through a few revisions and then get an idea that might not pay off.

We can start a branch to explore our idea while others continue work on the main trunk.

 

2.2.2 Merging a Branch

 

2.2.3 Combating Drift

Over time, a long-running branch can get so far out of sync with changes being made to the trunk that the final merge becomes difficult or even impossible.

2.3 Collaboration

2.3.1 Locking

2.3.2 Conflicts & Resolution

Modern VC systems inspect a proposed commit from a checked out revision rev to see if it alters any files that have changed in the repository since rev was checked out.

2.3.3 Conflicts and Branching

Because different branches are often edited in parallel, conflicts are most often detected when attempting to merge branches.


3 Forges & Repository Hosts

Software Forges provide a collection of project management tools for software development.


Forges differ from artifact repositories (e.g., Maven Central & JCenter) in their emphasis on