MATLAB Projects causes error on git (missing HEAD)

조회 수: 30 (최근 30일)
Khairul Adib Yusof
Khairul Adib Yusof 2022년 3월 25일
편집: Khairul Adib Yusof 2022년 3월 28일
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!

채택된 답변

Khairul Adib Yusof
Khairul Adib Yusof 2022년 3월 28일
편집: Khairul Adib Yusof 2022년 3월 28일
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!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Source Control에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by