What is Version Control?

by | May 14, 2013 | Development

Share this post

Git is our tool of choice for version control.

“Git along little doggie!”

Version control, Git, and Subversion are terms you’ve probably heard mentioned by a developer or project manager at some point. What do they mean, however, and what do they matter to a project? At CommonPlaces, we use version control on all of our clients’ projects, and Git is our tool of choice, as well as the one preferred these days by many developers in the industry.

In the software world, version control refers to using a system to track every change ever made to the files that make up your application. This is commonly called a VCS, or version control system. Tools like Git, or Subversion, which is also popular, work by storing the changes to all files under version control in a database, or repository. Each change, or set of changes, has a revision number or ID that can be used to see exactly what changed at any particular point in the project ‘s development.

Typically, a developer will do some work locally, making changes and testing, until reaching a point when deciding to commit the changes. One simple command is all that is required to tell the VCS that it’s time to update its database with the record of what changed in that file or group of files. You can commit whenever you like, although the mantra “commit early, commit often” certainly is one to live by.

Let’s say you did some work, maybe a whole LOT of work, and then realized you ‘d pursued the wrong path. You need to go back to the way things were before you started. With version control, it’s simple. With one command, you can get right back to the state of your code before you started. In fact, as long as you’ve been continually committing your work, you can retrace your steps anywhere along the way.

Suppose a file is accidentally deleted; or worse, something catastrophic happens and multiple files have been lost, possibly even the entire copy of the code. If you’ve been committing and pushing your changes up to the main repository, you can rest assured that it isn’t gone for good. One command will bring it all back.

Version control is particularly helpful when you have more than one person working on a project, which is often the case at CommonPlaces. Each developer can be working in a separate sandbox, but sharing access to the same repository. Then, when a developer commits the work and pushes it up to the main repository, everyone else can pull down a copy of it and update their individual sandbox with the latest code.

It’s also not unusual for the same section, or line, of code to be changed by two people. With version control and other tools which allow you to compare files, it’s easy to see who changed what and resolve any conflicts that may have occurred. Even if just one person is working on the project, version control makes it possible to go back and look at any change along the way, solving problems like what recent change broke something that used to work.

Sometimes a site adds new features, while simultaneously some rudimentary tweaks or improvements are also being made. The half-finished new feature isn’t ready for prime time yet, but those tweaks need to be released as soon as possible. How do those changes that are ready get pushed to the live site?

By using version control this becomes effortless, and is called parallel lines of development. New feature work can be done in a branch, which is created by taking a snapshot or copy of the code, then doing the new work in that copy without affecting the main line of development. When the new work has been completed and tested, the branch is merged back into the main line. This automatically combines all the code changes for the new feature with any modifications that may have happened in the meantime, like those tweaks or quick minor improvements previously mentioned.

Version control benefits every project’s stakeholders by improving efficiency, communication, and source code management. Tools like Git and Subversion are integral parts of the development process. I’ve been using different VCS methods myself for over 20 years now, and I can’t imagine doing it any other way.

What methods work for you?

Insights

Helping B2B leaders use technology to drive business

2026 B2B Content Marketing Trends

2026 B2B Content Marketing Trends

What Mid-Market Leaders Need to Do Right Now Over the past year, my team and I have been doing something that’s become surprisingly rare in digital business: meeting face-to-face with our clients. Whether it's healthcare technology, B2B manufacturing, nonprofits, or...

The Cost of Not Doing Anything

The Cost of Not Doing Anything

Why B2B and Nonprofits Should Invest in Their Websites and Portals In today’s digital first world, a website or customer portal isn’t just a “nice to have” ,  it’s the foundation of your organization’s success. Yet, many B2B companies and nonprofits fall into the trap...

A Guide To The Difference Between GEO, AIO and SEO

A Guide To The Difference Between GEO, AIO and SEO

For years, we built websites to earn authority with search engines.  Recent research outlines how AI summaries replacing traditional search results and are having a tremendous negative effect on website traffic.  Since SEO is no longer driving customers to your site,...