About Source Control with Projects
You can use a project to work with source control. You can perform operations such as update, commit, merge changes, and view revision history directly from the project environment.
In MATLAB®, projects have interfaces to:
Git™— See Set Up Git Source Control.
Subversion® (SVN) — See Set Up SVN Source Control.
Software Development Kit (SDK) — You can use the SDK to integrate projects with third-party source control tools. See Write a Source Control Integration with the SDK.
Tip
You can check for updated source control integration downloads on the projects
Web page: https://www.mathworks.com/products/simulink/projects.html
To use source control in your project, use any of the following workflows:
Add source control to a project. See Add a Project to Source Control.
Retrieve files from an existing repository and create a new project. See Clone Git Repository or Check Out SVN Repository.
Create a new project in a folder already under source control and click Detect. See Create a New Project from a Folder.
Make your project publicly available on GitHub®. See Share Project on GitHub.
When your project is under source control, you can:
Caution
Before using source control, you must register model files with your source control tools to avoid corrupting models. See Register Model Files with Source Control Tools.
To view an example project under source control, see Explore Project Tools with the Airframe Project.
Classic and Distributed Source Control
This diagram represents the classic source control workflow (for example, using SVN).
Benefits of classic source control:
Locking and user permissions on a per-file basis (e.g., you can enforce locking of model files)
Central server, reducing local storage needs
Simple and easy to learn
This diagram represents the distributed source control workflow (for example, using Git).
Benefits of distributed source control:
Offline working
Local repository, which provides full history
Branching
Multiple remote repositories, enabling large-scale hierarchical access control
To choose classic or distributed source control, consider these tips.
Classic source control can be helpful if:
You need file locks.
You are new to source control.
Distributed source control can be helpful if:
You need to work offline, commit regularly, and need access to the full repository history.
You need to branch locally.