Can't find what you are looking for? Try these pages!

Blog

The Case for Distributed Source Control

By Dennis Piccioni

A few years ago, I wrote a series of blogs about version control. The reasons for using version control are all still relevant; I wouldn’t develop without it. At the time I wrote those posts, distributed version control software (DVCS) such as Git was already around, but it has come a long way since those early days. Today, DVCS is the de-facto industry standard for version control, and for very good reasons.

If you’re not already using DVCS, it’s now easier to get started and/or migrate to it than ever before with DataFlex – details are below. In particular if you are not using version control now, DVCS eliminates many of the complications of traditional (non-distributed) VCS. I will use Git for the purposes of this discussion, as it was the first DVCS and is the most mature and most used DVCS, and I have the most experience with it.

What is Distributed Version Control?

With a typical VCS, you have a central repository, typically running on your company’s server, which contains the master repository of source code for your projects. From there, anyone working on a project can “check in and check out” source code. In a nutshell, that’s how VCS works. There are variations, but this is the basic concept.

With DVCS, you have multiple repositories. Even if you recreate the “master” repository model, your local copy of the code is a full repository that is synchronized with a “master” repository. Your local repository can also become the “source” repository for other repositories (e.g. your colleagues’ repositories) and you can sync code between any number of other repositories, not just the “master.”

File Based

Most traditional VCSs are server based. SourceGear Vault, for example, runs on top of Windows and SQL Server. Git is file-based, so to copy or back up a repository, you can simply copy the .git subfolder of your workspace to another drive, USB stick or your Dropbox.

This makes it far simpler to start and maintain Git repositories than traditional VCSs.

It’s Flexible

DVCS is designed to be flexible for you, the developer. The concept of branching was designed into Git from the start, so it’s a big part of the product, not just an afterthought. While it is possible to branch using traditional VCS, doing so using Git is trivial. It allows you to easily make multiple branches of any project, so you can experiment and test various code alterations easily, then merge the best solution into your project.

Visual Tools

Unlike a few years ago, Git now has mature UI front ends. There are many UIs for Git to choose from, both free and paid. BitBucket has a free UI for Git named SourceTree, which is decent enough to get you started. SmartGit is a popular paid Git UI.

Online Tools

There are many online tools and services for Git, including repository hosting such as BitBucket and GitHub, many of which are free for individuals or small teams.

BitBucket even has some DVCS tools built-in. You can log into the site, create and manage repositories, view project source, view branches and commits, and even allow team members to review commits (via pull requests) and merge commits.

GitLab has tools to allow you to host Git in-house.

It Runs Everywhere

Git is operating system agnostic and runs on Windows and Linux with many tools for either one or both OSs.

Getting Started

Whether you are switching from traditional VCS or getting started with DVCS, allow yourself some time to get acquainted with the tools and the process. With some practice, it will just become part of your workflow and you’ll wonder how you ever worked without it.

Just as with traditional VCS, you will want to decide on a workflow before you get started. Read up a bit on Git workflow.

Should you switch to DVCS if you’re already using VCS now? Maybe. As with all new tools, there will be a learning curve and it’ll take time to switch over. So, I wouldn’t recommend switching if you don’t have some extra time to deal with “learning curve” issues as they occur, because they will.

DataFlex and Version Control

DataFlex developers can now enjoy the benefits of version control systems like Git directly from within the Studio. How? The Studio’s command line replacement tags can be configured to call Git or other version control systems. These calls use the replacement tags to pass information to Git to manipulate the files currently open in the Studio. You can find more information about using the command line replacement tags in the DataFlex Help under Development Tools > Studio > The Studio Desktop > Menus > Tools Menu > Configure Tools Menu. Marco Kuipers wrote an excellent, detailed article about Using Git with DataFlex. Beyond that, Git is the industry standard tool now and you can find tons of resources about it via Google.