If you are a new user to source control, it is recommended that you select a source control system that is part of the MathWorks® source control integration with the Current Folder browser, such as Subversion® or Git™. For more information, see SVN and Git Source Control Integration topics.
In your source control system, create the projects that your folders and files will be associated with.
All files in a folder must belong to the same source control project. Be sure the working folder for the project in the source control system specifies the correct path to the folder on disk.
This example uses the project
my_thesis_files in Microsoft® Visual SourceSafe®.
This illustration of the Current Folder browser shows the path to
the folder on disk,
The following illustration shows the example project in the source control system.
To set the working folder in Microsoft Visual SourceSafe for
this example, select
select Set Working Folder from the context
menu, and specify
D:\my_thesis_files in the resulting
In MATLAB®, specify the source control system you want to access. On the Home tab, in the Environment section, click Preferences > MATLAB > General > Source Control.
The currently selected system is shown in the Preferences dialog box. The list includes all installed source control systems that support the Microsoft Common Source Control standard.
Select the source control system you want to interface with and click OK.
MATLAB remembers preferences between sessions, so you only need to perform this action again when you want to access a different source control system.
If you run a 64-bit version of MATLAB and want MATLAB to interface with your source control system, your source control system must be 64-bit compliant. If you have a 32-bit source control system, or if you have a 64-bit source control system running in 32-bit compatibility mode, MATLAB cannot use it. In that event, MATLAB displays a warning about the problem in the Source Control preference pane.
Register a source control system project with a folder in MATLAB, that is, associate a source control system project with a folder and all files in that folder. Do this only one time for any file in the folder, which registers all files in that folder:
In the MATLAB Current Folder browser,
select a file that is in the folder you want to associate with a project
in your source control system. For example, select
This will associate all files in the
Right-click, and from the context menu, select Source Control > Register Name_of_Source_Control_System Project with MATLAB. The Name_of_Source_Control_System is the source control system you selected using preferences as described in Specify Source Control System with MATLAB Software.
The following example shows Microsoft Visual SourceSafe.
In the resulting Name_of_Source_Control_System Login dialog box, provide the user name and password you use to access your source control system, and click OK.
In the resulting Choose
project from Name_of_Source_Control_System dialog box,
select the source control system project to associate with the folder
and click OK. This example shows
The selected file, its folder, and all files in the folder,
are associated with the source control system project you selected.
For the example, MATLAB associates all files in
the source control project
Add files to the source control system. Do this only once for each file:
In the Current Folder browser, select files you want to add to the source control system.
Right-click, and from the context menu, select Source Control > Add to Source Control.
The resulting Add to source control dialog box lists files you selected to add. You can add text in the Comments field. If you expect to use the files soon, select the Keep checked out check box (which is selected by default). Click OK.
If you try to add an unsaved file, the file is automatically saved upon adding.