Clone Git Repository or Check Out SVN Repository

Create a new local copy of a project by retrieving files from source control. You can clone a Git™ repository, or check out files from an SVN repository, or use another source control integration.

  1. On the MATLAB® Home tab, select New > Project > From Git or From SVN.

    Alternatively, in the Simulink®start page, click one of the Project from Git or Project from SVN templates.

  2. If you know your repository location, you can paste it into the Repository path in the New Project From Source Control dialog box and proceed to step 4.

    To browse for and validate the repository path to retrieve files from, click Change.

    1. In the dialog box, specify the repository URL by entering or pasting a URL into the box, using the list of recent repositories, or by using the button to browse.

    2. Click Validate to check the repository path. If the path is invalid, check the URL against your source control repository browser.

    3. If you see an authentication dialog box for your repository, enter the login information to continue.

    4. If necessary, select a deeper folder in the repository tree. With SVN, you might want to check out from trunk or a branch folder under tags.

    5. When you have finished specifying the URL path you want to retrieve, click OK.

  3. In the New Project From Source Control dialog box , select the working folder where you want to put the retrieved files for your new project, and click Retrieve. With SVN, use local folders, because using a network folder is slow.

    The source control pane (for example, Git or SVN) displays messages as the project retrieves the files from source control.

    If your repository already contains a project, the project is ready when the tool finishes retrieving files to your selected sandbox folder.

  4. If your sandbox does not yet contain a project, then a dialog box prompts you to check whether you want to create a project in the folder. To create a project, specify a project name and click OK.

    The Welcome screen appears to help you set up your new project.

    1. Click Set Up Project.

    2. On the next screen, add your project folders to the project path.

    3. On the next screen, specify any startup or shutdown files to automate tasks when you open and close projects. Alternatively, you can set up these files later. To learn more about these setup steps, see Create a New Project From a Folder.

      Click Finish.

      The project automatically adds all your files to the project and displays the Files view. For next steps using your new project, try dependency analysis to visualize the structure of your files. See Run a Dependency Analysis.


To update an existing project sandbox from source control, see Update Revisions of Project Files.


If you encounter errors like OutOfMemoryError: Java heap space when cloning big Git repositories, then edit your MATLAB preferences to increase the heap size.

  1. On the Home tab, in the Environment section, click Preferences.

  2. Select MATLAB > General > Java Heap Memory.

  3. Move the slider to increase the heap size, and then click OK.

  4. Restart MATLAB.

Related Examples

More About