If you want to add version control to your files without sharing with another user, it is quickest to create a Git™ repository and sandbox on your local system. To instead clone an existing remote Git repository, see Retrieve Files from Git Repository.
Before using source control, you must register binary files with your source control tools to avoid corruption. For more information, see Register Binary Files with Git.
To create a Git repository and sandbox on your local system:
Right-click in the white space (any blank area) of the MATLAB® Current Folder browser and select Source Control > Manage Files. MATLAB opens the Manage Files Using Source Control dialog box.
In the Source control integration list, select
Click the Change button. MATLAB opens the Select a Repository dialog box.
Click the Create a Git repository on disk () button.
Select an empty folder or create a new folder in which you want to create the repository and then click Select Folder. MATLAB creates the repository, closes the dialog box and returns to the Select a Repository dialog box.
Click Validate to check the path to the new repository, and then click OK. MATLAB closes the dialog box and returns to the Manage Files Using Source Control dialog box.
In the Sandbox field, specify the location for your sandbox. The selected folder must be empty.
Click Retrieve to create the sandbox.
After creating the Git repository and sandbox, add your files to the sandbox. Then, commit the first version of your files to the new repository. For more information, see Mark Files for Addition to Source Control.
You also can change the repository URL after the repository is created. In the Current Folder browser, in a folder under source control, right-click, and select Source Control > Remote and specify a new URL.
To use a Git server for the repository on your local system, you can use a Git server hosting solution or set up your own Apache™
Git server. If you cannot set up a server and must use a remote repository via
the file system using the
file:/// protocol, make sure that it is a
bare repository with no checked out working copy.