Some errors related to MATLAB Git integration can be resolved using the following fixes:
Tested on MATLAB R2022a
- Close MATLAB.
- Generate SSH key as described here:
ssh-keygen -t ed25519 -C "your_email@example.com"
- Rename the private and public keys in
~\.ssh
toid_rsa
andid_rsa.pub
This error is more likely to happen if MATLAB Project is used within the repo.
- If you are using Google Drive for Desktop that constantly syncs local folders to the cloud, this is the probable cause.
- 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.
- Currently, there are no fixes, but possible workarounds include: (i) cloning repo outside synced folders, (ii) use OneDrive (no issue so far).