Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

工程中的源代码管理

配置源代码管理、检索文件、审核更改内容、提交已修改文件

通过工程,您可以查找所需的文件、管理并共享文件和设置以及与源代码管理进行交互,从而有助于您组织大型建模工程。请参阅什么是工程?About Source Control with Projects

函数

全部展开

currentProject获取当前工程
openProject加载现有工程
listModifiedFiles列出工程中修改的文件
listRequiredFiles获取工程文件依存关系
refreshSourceControl更新工程文件的源代码管理状态
runChecks运行所有工程检查
Simulink.getFileChecksumChecksum of file

旧版 API

simulinkproject(不推荐)打开工程并获取工程对象
listModifiedFiles(Not recommended) List modified files in project
listRequiredFiles(Not recommended) Get project file dependencies
refreshSourceControl(Not recommended) Update source control status of project files

主题

源代码管理设置

About Source Control with Projects

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

Add a Project to Source Control

Add Git or SVN source control to your project.

Register Model Files with Source Control Tools

Register model files as binary.

设置 Git 源代码管理

配置 Git,注册模型文件,并对 MATLAB® 使用 SSH 身份验证。

Create New GitHub Repository

Create an empty remote GitHub® repository.

在 GitHub 上共享工程

要共享您的工程,请在 GitHub 上使您的工程公开可用。

Add Git Submodules

Clone an external Git™ repository as a submodule.

设置 SVN 源代码管理

配置 SVN、注册模型文件、锁定文件、共享存储库以及管理 SVN 外部引用。

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 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.

检索和签出

Clone Git Repository

Retrieve a working copy of a project from Git source control.

Check Out SVN Repository

Retrieve a working copy of a project from SVN source control.

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 Git or SVN.

Get SVN File Locks

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

审核更改内容、提交已修改文件

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 local Git repository or SVN repository.

Revert Changes

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

使用 Git 取回、推送和提取文件

用于提取、合并更改和将更改推送到远程存储库的 Git 工作流。

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.

Convert from MDL to SLX in a Project and Preserve Revision History

A project helps you upgrade model files from MDL format to SLX format.

Work with Derived Files in Projects

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

特色示例