MATLAB: How to use Git for version handling Simulink files

gitsimulinkversion control

Hello What is the best way to version handle Simulink code using Git? I have looked at Simulink's .slx files and these seem to be binary files (as opposed to .m files that are simple text files). I am interested in being able to use Git to allow branching, merging branches and seeing the differences between two branches. Git can easily do this for text files but runs into problems with binary files. Is there a good way to handle this with Git? Best regards Nils

Best Answer

Hi Nils,
The SLX file format can be considered a binary file and could be treated in GIT as any other binary file, i.e. it cannot be diff'd with a traditional text comparison tool.
As of R2016a release of MATLAB and onward there is a 3-way Diff/Merge tool supplied by the Simulink Report Generator Toolbox, which can be configured to work with your external source control tool .
HTH, ~Zack