Development Environment    

Adding Files to the Source Control System

You can add a single file or multiple files to the source control system. Note that the file is first added to the source control system using the Add command, not the Check In command.

Adding a Single File

To add a file to the source control system:

  1. Select Source Control -> Add to Source Control from the File menu in the MATLAB Editor, Simulink model, or Stateflow model.
  1. The MATLAB Add to source control dialog box opens.

  1. If you want to add the file to the source control system and keep it checked out so you can continue making changes, select Keep checked out. This is selected by default. If you have comments, type them in the Comments area.
  1. Your comments will be submitted whether or not you select Keep checked out.

  1. Click OK.
  1. The file is added to the source control system. If you did not save the file before adding it to the source control system, it is automatically saved when it is added.

    If you did not keep the file checked out and you keep the file open, note that it is a read-only version.

Adding Multiple Files

To add multiple files to the source control system:

  1. Select the files in the MATLAB Current Directory window.

  1. Right click on the selected files.
  2. Select Source Control -> Add to Source Control from the pop-up menu.
  1. The MATLAB Add to source control dialog box opens.

  1. If you want to add the files to the source control system and keep them checked out so you can continue making changes, select Keep checked out. This is selected by default. If you have comments, type them in the Comments area.
  1. Your comments will be submitted whether or not you select Keep checked out.

  1. Click OK.
  1. The files are added to the source control system. If you did not save the files before adding them to the source control system, they are automatically saved when they are added.

    If you did not keep the files checked out and you keep the files open, note that they are read-only versions.

Function Alternative for Adding File to Source Control

Use add as the first argument in the verctrl function to add a file to the source control system. Note that the verctrl function with the add argument returns a logical 1 to the workspace if the file has changed on disk or a logical 0 to the workspace if the file has not changed on disk. You can add a single file or multiple files. The verctrl function with the add argument has this form:


  Selecting and Viewing the Source Control System Checking Files Out of the Source Control System