Skip to content
AgileLogics

Programming glossary

Version Control

A system that records every change to a project's code over time, so you can review or revert to any earlier point.

A time machine for your code

Without version control, people end up with folders full of files like final.php, final-v2.php, and final-really-final.php. Version control replaces that mess. You save snapshots of your project at meaningful moments, each with a short message describing what changed. Later you can see exactly what was altered between two snapshots, find out when a bug crept in, or roll a file back to how it was a week ago.

It also makes teamwork possible. Several developers can edit the same project at once, each on their own branch, and the system helps combine the work. When two people change the same lines, it flags a conflict for a human to sort out instead of silently overwriting someone's edits.

Git is by far the most widely used system today. Older ones such as Subversion (SVN) and Mercurial are still around.

A typical Git workflow

git switch -c fix-login     # new branch; now edit some files
git status                  # see what changed
git diff                    # review the exact edits
git commit -am "Fix login redirect"
git switch main
git merge fix-login         # bring the fix into main

The -a flag only stages files Git already tracks; brand-new files need git add first.

Version control vs backups

A backup copies your files so you can recover from a lost disk. Version control records why and how files changed, in small, labelled steps. You can ask it "what did this function look like before Tuesday's change?" and get a precise answer. Backups rarely offer that. Still, a local repo is not a backup on its own; pushing to a remote copy protects you if your machine dies.

The project folder together with all that recorded history is called a repository. To compare two versions of a file outside Git, the code diff tool shows changes side by side.

Learn more

Last updated