This is small tutorial of setting up verison control for Labview, with the built in LVCompare and LVMerge tools using SourceTree
In this documentation I will show you, how to setup version control for Labview using Git. Requirements:
- Labview (version 20 was tested, but should work with any other before 21)
- SourceTree (or any other Git GUI of your choice)
- A remote repository (I have mine on GitHub)
Unlike other platforms, verison control wiht Labview is a bit different. Due to its graphical programming nature, none of the platforms are able to open and compare these files. NI has developed tools to solve this problem, namely LVCompare.exe and LVMerge.exe. In the following I will go step by step, how to connect a Git client with the Labview tools.
You can download Sourcetree from here. After the setup is complete, the Git client should be installed also. Next you should connect your remote repository to the client, and clone it to your local disk.
To connect the Git client to Labview I have followed this tutorial, which has everythin you need. In short, open a terminal in SourceTree and copy the following command:
cd && git clone https://gitlab.com/sas-blog/LVCompare-Merge-Setup.git && cd LVCompare-Merge-Setup && ./setupLVTools.sh
This should clone the neccessary scripts to your disk, and setup LVCompare and LVMerge as the default diff and merge tools. After that you should be ready to go!
To compare remote and local files, you should select the "External Diff" option in the dropdown menu:
It should launch LVCompare.exe, where the differences are highlighted in circles:
If you want, you can launch these tools from command line using the:
git difftool
and git mergetool
command. Try git help ...
for additional information.
This tutorial is just a small summary of the whole process, all credit goes to (https://gitlab.com/sas-blog), who made the needed scripts.