MATLAB Projects causes error on git (missing HEAD)

30 visualizaciones (últimos 30 días)
I have tried many times to integrate my repository with MATLAB Projects. Initially, everything seems fine - I was able to add the *.prj file and everything in the resources/project folder and push them to GitHub. Then, after adding submodules in the repository, I was unable to do anything (fetch, pull, push, refresh etc). UPDATE: It doesn't have to do with submodules, the error could happen even before adding any submodules. It seems like my local repo is corrupted (?). I have tried this again and again (deleting the local repo and cloning from the remote) to no avail. I even try creating a dummy repo and initializing a project there, same results. This is the error that always appears:
Unable to fetch from the remote 'origin' at <the repo url>.
object not found - no match for id (<latest commit ID (HEAD)>) (-3x9)
Even right-clicking in the current directory gives an error:
Please help as I really want to use projects as they are quite convenient to deal with dependencies. Thank you!

Respuesta aceptada

Khairul Adib Yusof
Khairul Adib Yusof el 28 de Mzo. de 2022
Editada: Khairul Adib Yusof el 28 de Mzo. de 2022
This has been resolved. The cause has nothing to do with MATLAB (although it is more likely to happen if MATLAB Project is used within the repo). It is caused by Google Drive or OneDrive desktop integration as described here:
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.
Fix: Pause the background sync when you are working with MATLAB.
I hope this helps somebody in the future!

Más respuestas (0)

Categorías

Más información sobre Source Control en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by