Git For MATLAB

From Cheaha
Jump to navigation Jump to search


Attention: Research Computing Documentation has Moved
https://docs.rc.uab.edu/


Please use the new documentation url https://docs.rc.uab.edu/ for all Research Computing documentation needs.


As a result of this move, we have deprecated use of this wiki for documentation. We are providing read-only access to the content to facilitate migration of bookmarks and to serve as an historical record. All content updates should be made at the new documentation site. The original wiki will not receive further updates.

Thank you,

The Research Computing Team

MATLAB on Cheaha has been configured to work with Git.

Option 1: Cloning a Git Repository into MATLAB

Create a clean folder to use with Git

To start out with, MATLAB's Git requires an empty folder. Currently this is just an empty folder with no source control (a regular MATLAB folder).

start out with a clean folder

If you have no empty folder, create one, as MATLAB's Git will give an error if there are any files in the folder.

Clone a Git Repository using MATLAB

Right click in the file browser to bring up the context menu. Navigate to and select Source Control->Manage Files

initializing source control

The "Manage Files using Source Control" interface will pop up. Select ""Git"" for your ""Source Control Integration"" option. Under ""Repository Path"" you place the URL of the repository you are going to clone into your empty directory. ""Sandbox"" should be filled in with the current directory. Ideally this is the directory in which you wish to place the cloned repository.

initializing source control

In this screenshot a sample GitLab Repository URL is pasted into the ""Repository Path"" text box. If you click "Change" on the same line, an additional window will appear where you can also validate the link prior to attempting to clone the repository.

Once this dialog has been filled in appropriately, clicking the "Retrieve" button will initialize the repository and checkout the current revision into the selected folder