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™— SeeSet Up Git Source Control.
Subversion®(SVN) — SeeSet Up SVN Source Control.
Software Development Kit (SDK) — You can use the SDK to integrate projects with third-party source control tools. SeeWrite a Source Control Integration with the SDK.
Tip
You can check for updated source control integration downloads on the projects Web page://www.tatmou.com/products/simulink/projects.html
To use source control in your project, use any of the following workflows:
Add source control to a project. SeeAdd a Project to Source Control.
Retrieve files from an existing repository and create a new project. SeeClone Git RepositoryorCheck Out SVN Repository.
Create a new project in a folder already under source control and clickDetect. SeeCreate a New Project From a Folder.
Make your project publicly available on GitHub®. SeeShare Project on GitHub.
When your project is under source control, you can:
Caution
之前e using source control, you must register model files with your source control tools to avoid corrupting models. SeeRegister Model Files with Source Control Tools.
To view an example project under source control, seeExplore Project Tools with the Airframe Project.
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)
中央服务器,减少本地存储的需求
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.