‹ Version Control Setup

Integrating Simulink and Stateflow with TortoiseGit using SimDiff

TortoiseGit launches SimDiff for .mdl and .slx when you compare versions or resolve a merge conflict.

TortoiseGit can launch an external diff or merge tool when you compare versions or resolve a merge conflict. One external tool can cover every file. That is not recommended for SimDiff. Configure the tool for particular file extensions instead.

If there is no merge conflict, TortoiseGit does not launch the external tool. For example, if a model file changed on a branch and did not change on the main branch, merging the branch does not open SimDiff.

More on merging and resolving conflicts is in the TortoiseGit documentation: Merging and Resolving conflicts.

Configuring SimDiff with TortoiseGit

You can configure SimDiff for diff, for merge, or for both. Open the TortoiseGit Settings dialog first: right-click in Windows Explorer, then TortoiseGit, then Settings.

Windows Explorer menu with TortoiseGit open and Settings circled in red

Configuring SimDiff as a diff tool

  1. In the sidebar tree, select Diff Viewer.
  2. Click Advanced to open the advanced settings.
  3. Edit the entry for an existing extension, or add a new entry if it does not exist.
  4. Enter .mdl or .slx as the extension. Repeat these steps for the other extension if you want both.
  5. Enter the command below and press OK in every dialog.
"C:\Program Files\EnSoft\SimDiff\simdiff4.exe" -l %base -r %mine
TortoiseGit advanced diff settings, numbered 1 to 5: Diff Viewer, Advanced, Add, extension .mdl, and external program SimDiff 4 simdiff4.exe with -l %base -r %mine

Configuring SimDiff as a merge tool

  1. In the sidebar tree, select Diff Viewer, then Merge Tool.
  2. Click Advanced to open the advanced settings.
  3. Edit the entry for an existing extension, or add a new entry if it does not exist.
  4. Enter .mdl or .slx as the extension. Repeat these steps for the other extension if you want both.
  5. Enter the command below and press OK in every dialog.
"C:\Program Files\EnSoft\SimDiff\simdiff4.exe" -merge -b %base -l %mine
-r %theirs -o %merged
TortoiseGit Merge Tool settings, numbered 1 to 5: Merge Tool, Advanced, Add, extension .mdl, and an external program ending in EnSoft\\SimDiff 4\\simdiff4.exe with -merge -b %base -l %mine -r %theirs -o %merged

The commands above assume SimDiff is in its default install directory. Change the command if it is installed somewhere else.

More on external tools is in the TortoiseGit documentation.

Viewing Differences

Using another client? See Version Control Setup.