Skip to content

Instantly share code, notes, and snippets.

@khairuladib94
Last active March 28, 2022 17:08
Show Gist options
  • Save khairuladib94/859b0ea23cb46b9f76756c771cf1f1d2 to your computer and use it in GitHub Desktop.
Save khairuladib94/859b0ea23cb46b9f76756c771cf1f1d2 to your computer and use it in GitHub Desktop.
Fixing errors for MATLAB Git integration

Some errors related to MATLAB Git integration can be resolved using the following fixes:

Tested on MATLAB R2022a

Error 1: SSH authentication fails

  1. Close MATLAB.
  2. Generate SSH key as described here:
ssh-keygen -t ed25519 -C "your_email@example.com"
  1. Rename the private and public keys in ~\.ssh to id_rsa and id_rsa.pub

Error 2: Local repo corrupted sporadically

This error is more likely to happen if MATLAB Project is used within the repo.

  1. If you are using Google Drive for Desktop that constantly syncs local folders to the cloud, this is the probable cause.
  2. This excerpt describes the error cause:

The problem boils down to a race condition where Git creates and modifies files rapidly and the storage solution trying to keep up. In some scenarios this can lead to file IO not behaving as Git expects. A storage solution might also erroneously restore a file that was meant to be removed. While these sort of issues are most likely to occur when you're sharing the repository with other people we've seen issues with people who only use the storage for backup purposes.

  1. Currently, there are no fixes, but possible workarounds include: (i) cloning repo outside synced folders, (ii) use OneDrive (no issue so far).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment