Lets Work Together

Speak with us

21st December 2020

How to use version control for software and hardware

Version control is essential for engineering development, verification, and support.  This applies equally to electronics hardware, software and firmware.  Having a robust way of managing changes prevents guesswork, minimises the effect of a “bad day” and provides a complete picture when the history is needed for an investigation. 

The benefits of a recognised version control system

You could choose a low-tech approach of simply numbering versions as they are saved 0.1, 0.2 etc BUT this can quickly get into a mess and doesn’t allow easy comparisons between versions. It is better to use a recognised version control system or vcs.  Git, Subversion and Mercurial are all version control systems each of which have their own architectures, foibles and methodologies.  The pro’s and con’s of each system depend on your own requirements, file types and ways of working. 

Having a (backed up) repository means that when you have a bad day, go down a rabbit hole, and remove some previous work and then realise that it was right all along, nothing is lost.  The previous incarnation can be retrieved. 

Don’t forget to make notes

Each commit back to the repository can, and should, have notes associated with it.  This makes the repo more user friendly and builds a history as it develops.  Formal releases of schematics, printed circuit boards, gerber files, bills of materials, dll’s, libraries, binaries and source code can have the full release package secured in the repo to give certainty over what was in each release and allow the release to be reproduced if needed. 

Using branches

Some vcs systems allow tree like structures to be setup.  The main development path can be on one line with other branches veering off for trial features or developing new functionality.  This also allows each released version of code to be maintained so that critical bug-fixes can be made to an older code release without being forced to update to the latest and greatest code base. Approaches like this can be helpful where a complex configuration needs just one key update which can be applied and tested without bringing in other potential issues.  

Collaborative working

Version control repositories also open the option for collaborative working between multiple developers in different locations on the same or different branches.  Different coders can work on different parts of a software project before uploading or committing their well tested and commented updates back to the repository for integration.  In multi-developer environments care needs to be taken that commits are not done at the end of the day – commit and run should be strongly discouraged because buggy code can cause the other collaborating developers’ problems. 

Ignys software and hardware services

We offer many services for hardware and software. See our full services carousel to search for what you’re looking for.

+44 (0)115 772 2825

Blog authorship

This article was written by Richard Fletcher Ignys MD with over 20 years experience.