Desktop Tools and Development Environment |
Setting Up the Source Control Interface
Before you check files into and out of your source control system from MATLAB, perform the following actions to set up the source control interface:
Create Projects in Source Control System
In your source control system, create the projects that your directories and files will be associated with.
All files in a directory must belong to the same source control project. Be sure the working directory for the project in the source control system specifies the correct pathname to the directory on disk.
Example of Creating Source Control Project. This example uses the project my_thesis_files
in Microsoft Visual SourceSafe. This illustration of the Current Directory browser shows the pathname to the directory on disk, D:\my_thesis_files
.
The following illustration shows the example project in the source control system.
To set the working directory in Microsoft Visual SourceSafe for this example, select my_thesis_files
, right-click, select Set Working Folder from the context menu, and specify D:\my_thesis_files
in the resulting dialog box.
Specify Source Control System in MATLAB
In MATLAB, specify the source control system you want to access. Select File -> Preferences -> 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.
Function Alternative. A function alternative to select a source control system is not available, but you can list all available source control systems using verctrl
with the all_systems
argument. Use cmopts
to display the name of the currently selected source control system.
Register Source Control Project with MATLAB
Register a source control system project with a directory in MATLAB, that is, associate a source control system project with a directory and all files in that directory. Do this only one time for any file in the directory, which registers all files in that directory:
D:\my_thesis_files\wind.m
. This will associate all files in the my_thesis_files
directory.
my_thesis_files
.
D:\my_thesis_files
with the source control project my_thesis_files
.
Add Files to Source Control
Add files to the source control system. Do this only once for each file:
If you try to add an unsaved file, the file is automatically saved upon adding.
Function Alternative. The function alternative is verctrl
with the add
argument.
Source Control Interface on Windows Platforms | Checking Files Into and Out of Source Control from MATLAB |
© 1994-2005 The MathWorks, Inc.