A developers blog

What the Heck is a Main Line?

By: Brad

Hey Brad, some of my co-workers are talking about committing their changes to the Main Line what the heck do you think they mean by that?


The Main Line is what we use to refer to the main continuity of your application. The flow from version 0.1 to version 199 is your Main Line. If your application was a story the Main Line would be your main story arch.


All new features are done on your main line as it is your application; development done on branches are typically merged into the mainline before release, unless they are hotfix/patch branches or one offs for a particular customer which won’t be included in your application as a whole.

The term Main Line is more of a general term as different source repositories tend to use their own terminology when describing a Main Line.

In Git, a distributed source repository, there is no special term for the Main Line as Git does not make any special notations between branches; everything is a branch and per the tool no branch is any more special then any other branch. One would think that the Main Line in Git is simply your integration branch. In Git each developer has their own branch as there is no concept of a working copy therefore each developer needs to integrate their changes with each other which is typically done via a conceptually special branch refereed to as the integration branch. No work is done on this branch except for Forward Integration’s; that is developers simply merge changes into this branch and don’t make changes within the branch directly. A Continuous Integration (CI) build system typically uses this branch when doing builds. Its possible that a new branch is created to start work on a new version and instead of integrating that branch into the integration branch (i.e. Main Line) the new branch just becomes the new integration branch, where the old one is deprecated, and therefore the new integration branch becomes the Main Line. In this way notice that the Main Line isn’t fixed to a particular branch but instead moves to which ever branch is your latest and greatest version of your application.


In a centralized source repository such as Perforce or SVN all developers work on the same branch; that is locally each developer works offline in a working copy then integrates their work with the primary branch. This primary branch could either be a hotfix/patch branch or the main application branch. Different repositories have different names for this primary branch; in Perforce its called Tip, in SVN the common convention is to call it Trunk; this primary branch is your Main Line.


So that is what the Heck the Main Line is; your applications main continuity and where all your development effort goes version after version.

Until next time think imaginatively and design creatively


My interest in computer programming started back in high school and Software Development has remained a hobby of mine ever since. I graduated as a Computer Engineering Technologist and have been working as a Software Developer for many years. I believe that software is crafted; understanding that how it is done is as important as getting it done. I enjoy the aesthetics in crafting elegant solutions to complex problems and revel in the knowledge that my code is maintainable and thus, will have longevity. I hold the designation Certified Technician (C.Tech.) with the Ontario Association of Computer Engineering Technicians and Technologists (OACETT), have been certified as a Professional Scrum Master level 1 (PSM I) and as a Professional Scrum Developer level 1 (PSD I) by as well as designated as an Officially Certified Qt Developer by the Qt Company. For more on my story check out the about page here

Feel free to write a reply or comment.