Source Control in Simulink Project

Configure source control, retrieve files, review changes, commit modified files

Simulink® Projects help you to organize large modeling projects by finding required files, managing and sharing files and settings, and interacting with source control. See What Are Simulink Projects? and About Source Control with Projects.


simulinkprojectOpen Simulink Project and get project object
listModifiedFilesList modified files in Simulink project
listRequiredFilesGet project file dependencies
refreshSourceControlUpdate source control status of Simulink project files
Simulink.getFileChecksumChecksum of file

Examples and How To

Source Control Setup

Add a Project to Source Control

Add SVN or Git source control to your project.

Register Model Files with Source Control Tools

Register model files as binary

Set Up SVN Source Control

Configure SVN, register model files, lock files, share repositories, and manage SVN externals.

Set Up Git Source Control

Configure Git, register model files, add Git submodules.

Share Project on GitHub

To share your Simulink project, make your project publicly available on GitHub®.

Disable Source Control

Disable source control to prepare a project template.

Change Source Control

Archive a project and create a new one with a different source control.

Write a Source Control Integration with the SDK

Use the Software Development Kit (SDK) to integrate Simulink Projects with third-party source control tools.

Customize External Source Control to Use MATLAB for Diff and Merge

Use the MATLAB® Comparison Tool for diff and merge from external source control tools.

Retrieval and Checkout

Retrieve a Working Copy of a Project from Source Control

Get files from an SVN repository or clone a Git repository.

Tag and Retrieve Versions of Project Files

With SVN, tag specific revisions of a project.

Refresh Status of Project Files

Check for locally modified project files.

Check for Modifications

Find out if the repository version has moved ahead.

Update Revisions of Project Files

Update revisions with SVN or Git.

Get SVN File Locks

With SVN, ensure users get locks on model files before editing.

Reviewing Changes and Committing Modified Files

View Modified Files

Examine changes in the project.

Compare Revisions

Review changes in modified files by comparing with ancestors, or compare particular revisions.

Run Project Checks

Check projects for problems such as unsaved changes, files not under source control, or derived files out-of-date.

Commit Modified Files to Source Control

Commit a change set to the repository (SVN) or local repository (Git).

Revert Changes

Discard local changes or choose a revision for a file or the whole project.

Pull, Push, and Fetch Files with Git

Git workflow for fetching, merging and pushing changes to the remote repository.

Branch and Merge Files with Git

Create, switch, merge, revert, and delete branches.

Resolve Conflicts

Locate and resolve conflicts; merge text files and merge models; extract conflict markers.

Upgrade Model Files to SLX and Preserve Revision History

Use Simulink Project tools to migrate models to SLX and maintain revision history.

Work with Derived Files in Projects

Best practices for derived files, such as .mex and slprj files.


About Source Control with Projects

What source control tools and workflows can I use in Simulink Project? Try built-in SVN or Git, or integrate third-party tools.

Was this topic helpful?