Github Repositories
Github is an online sharing and collaboration tool for software and other files. We'll use it primarily as a site where you can download additional toolboxes for MATLAB. A GitHub repository, or repo, is an online folder, typically with many subfolders and files. Different software is stored in different repos. These repos are synced with the developers' computers, so they always contain the latest version of the software. It's not just software files; for example, the files that make up this MTM documentation site are all stored in this GitHub repository.
For more information, consult the MATLAB GITHUB documentation and this site on "How github works."
Git & GitHub Crash Course for Beginners
Github repositories we'll be using
The following are add-on toolboxes for MATLAB:
- MtMtoolbox - A companion set of functions and scripts for use with the MtM documentation
- bfmatlab - Bio-formats toolbox to open Proprietary Microscope Image Formats and metadata. This toolbox is included in the MtMtools repository.
Installation (cloning)
We will add clones (copies) of these repositories to our MATLAB drive using the following steps.
Easy Clone MTM Tools
The MtM Tools repository comes with an easy-install button:
- The link will open the repository in MATLAB online
- Make sure that you are logged into your online Mathworks Account
- Clone the Repository when asked
- Notice that the MtMtools repo contains a copy of the bfmatlab toolbox
Updating GitHub Repositories
Overtime, Repositories such as the scripts folder and the course functions folder (MtMTools) will get updates (as your instructor completes the scripts or updates the functions). If you have been making changes to files on your computer (e.g. filling out the scripts in class) and you want to ensure that you still have access to changes you made, you can use git stash, as described on the MATLAB "Review and Commit Modified Files to Git" page
Basically, to stash all local changes, in the Source Control panel:
- Click the More source control options button
- Select "Stash Changes".
- In the Stash Files dialog box, provide the stash name and click Stash.
Once you have stashed your changes, you can downloaded the updates from the git repositories by performing a git pull:
- Click on the More source control options button
- Select "Pull"