Configure Source Control Settings - MATLAB & Simulink (original) (raw)

Use the general source control settings in MATLAB® to specify the default location of new Git™ and SVN working folders and disable MathWorks® source control integration.

On the Home tab, in the Environment section, click Settings. Select > . Then, configure your settings.

To configure Git-specific source control settings, see Configure Git Settings.

Setting Usage
Source Control Integrations MATLAB source control integration, accessible through the Files and Project panels, is enabled by default.To disable MATLAB source control integration, clear Enable source control.When you disable source control, MATLAB does not destroy repository information. For example, it does not remove the .svn and .git folders.
If you want to use other source control tools such as Perforce® P4V with MATLAB instead of the built-in source control integration, write your own source control integration using the Software Development Kit (SDK) available on File Exchange. Then, ensure that you selectEnable 3rd-party source control integrations (requires Java). For more information, see Write a Source Control Integration with the SDK.
Files To configure MATLAB to prompt you about unsaved changes before performing source control actions such as commit, merge, SVN update, and Git branch switch, select Check for unsaved files before source control operations.
By default, MATLAB and Simulink® reload files modified by source control operations, such as SVN update, and Git branch switch.To disable this behavior, clear the Reload files modified by source control operations check box.
New Working Folder When you interactively clone or check out a working copy from a repository, by default, MATLAB downloads files into the currently opened folder. To use a folder of your choice, select Use specified folder and specify the folder by using the browser or pasting the path.

Configure Git Settings

Use the Git source control settings to specify your username and email, remember credentials for the current MATLAB session, and enable SSH authentication.

On the Home tab, in the Environment section, click Settings. Select > > . Then, configure your settings.

Setting Usage
User Specify your username and email in the Name andEmail fields. Doing so sets the value ofuser.name and user.email in your global Git configuration file.
MATLAB Git integration is configured by default toGenerate local avatars using your initials. An avatar appears next to your username and email in the Branch Manager and when you annotate lines for files under Git source control in the MATLAB Editor.To enable MATLAB to retrieve globally-recognized avatars from web services such as gravatar.com, select Retrieve avatars from web services instead.To disable the usage of avatars altogether, select None instead.
Credentials By default, MATLAB Git integration remembers usernames and tokens when you interact with Git repositories. Persist credentials is the default selection.To configure MATLAB to remember Git credentials only in the current session, selectRemember credentials for the current MATLAB session.To disable the credential management altogether, select Disable credential management instead.
SSH To enable the use of SSH keys, select Enable SSH.By default, MATLAB looks for keys in the agent. On Windows®, use OpenSSH as the SSH agent. To install OpenSSH, seeGet started with OpenSSH for Windows.
If you are not using an SSH agent to store your keys, you can enter them manually.Clear the Use SSH agent checkbox.Specify the Public key file by using the browser or pasting the path to your public key file. An example path isC:\Users\_username_\.ssh\id_ed25519.pub.Specify the Private key file by using the browser or pasting the path to your private key file. An example path isC:\Users\_username_\.ssh\id_ed25519.In MATLAB Online™, SSH authentication is disabled by default. Using SSH keys in MATLAB Online requires you to store the public and private key files on MATLAB Drive.
To enable the use of a pass-phrase and receive a prompt once per session, select Key is pass-phrase protected.
Proxy To enable the use of a proxy, select Enable proxy. Then, specify the proxy you want to use in theProxy host field. Doing so sets the value of http.proxy in your global Git configuration file.
Commit Signing To enable signing commits automatically, select Sign commits.Set the signing key format by selecting one of theSigning format options. Supported key formats are OpenPGP (default) andX.509. Doing so sets the value ofgpg.format in your global Git configuration file.If you do not have an existing GPG key, you can generate a new GPG key to use for signing commits. For more information, see Generating a new GPG key.Set your signing key in the Public signing key field. Doing so sets the value ofuser.signingkey in your global Git configuration file.Specify the program used to sign commits in thePath to signing program field. Doing so sets the value ofgpg.x509.program orgpg.openpgp.program in your global Git configuration file.When MATLAB verifies a commit signature, a green verification icon appears next to your avatar and username in both the Branch Manager and the line annotations in the MATLAB Editor.
Branch Manager To control the number of commits that the Branch Manager shows, specify the Maximum number of commits to show.
Environment To enable MATLAB to use user-defined Git environment variables, select If defined, use Git environment variables. This setting is not available in MATLAB Online.
Windows To use Git LFS, Git hooks, a credential helper, or Simulink automerge on Windows, you must install a command-line Git client and follow steps described in Additional Setup.When you install Git command-line, MATLAB automatically populates Path to Git.Git command-line installation by default includes Git bash that provides shell utilities. MATLAB automatically populates Path to Shell. NoteTo use Git hooks in MATLAB on Windows, enable .sh files to run with Git Bash when you install command-line Git. For an example on how to use Git hooks, see Use Git Hooks in MATLAB.Automerging Simulink models on Windows requires a shell to be installed. For information on how to enable automerge in MATLAB and CI pipelines, see Automatically Merge Models Locally and in CI Pipeline (Simulink).
To enable support for long paths on a Windows system, select Enable support for long paths. Doing so sets the value ofcore.longpaths to true in your global Git configuration file.

Configure SVN Settings

MATLAB SVN integration remembers usernames and tokens when you interact with SVN repositories.

Use the SVN source control settings to adjust or disable credential management.

  1. On the Home tab, in theEnvironment section, clickSettings. Select > > .
  2. In the Credentials section, select from the available options.
    • The Persist credentials option is the default selection.
    • To configure MATLAB to remember SVN credentials only in the current session, select Remember credentials for the current MATLAB session.
    • To disable the credential management altogether, selectDisable credential management instead.

See Also

Topics