Main Content

Create Local Git Repository

If you want to add version control to your files without sharing with another user, you can create a local Git™ repository and working folder on your system without linking it to a remote repository.

To create a local Git repository and working folder:

  1. In the Current Folder browser, right-click the white space and select Source Control > Manage Files. MATLAB® opens the Manage Files Using Source Control dialog box.

  2. Set the Source control integration option to Git.

  3. Click the Change button next to the Repository path field. MATLAB opens the Select a Repository dialog box.

  4. Click the Create a Git repository on disk button.

  5. Select the folder in which to create and store the local repository and click Select Folder. The selected folder must be empty.

  6. Click the Validate button to validate the repository path. If the path is valid, click the OK button to return to the Manage Files Using Source Control dialog box.

  7. Enter the path of the working folder in which to store your files in the Sandbox field. The specified folder must be empty.

  8. Click the Retrieve button.

After creating a local repository and working folder, to change the path of the local repository, right-click in the working folder, select Source Control > Remote, and specify the new path.

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.

Note

In a production environment, do not rely on remote repositories via the file system using the file:/// protocol. The file protocol is not safe. Concurrent access might corrupt repositories.

See Also

Functions

Related Topics