Strange problem with git repo?

谁都会走 提交于 2019-12-05 12:10:57

For future reference, the only way I could correct the problem was to remove all submodules and then reinstall them.

In case it helps anyone else, I just encountered the same issue and found that running git init in the project root fixed it.

Your git-project (or at least one of your submodules, if you have some) became corrupted. This means that some of the files in your .git-folder(s) are corrupt or missing.

Fix git-repo

As Jordan mentioned: Go to your root and run git init. Then try git status again.

Fix submodules

If this doesn't work, navigate to your submodule-folder(s) and try git init again. Go back to root and run git status.

Why is it broken?

One answer could be, that there are problems with the access-permissions. Maybe you're working with several users on the working copy?

Another answer could be some kind of sync-software like OwnCloud, Dropbox, Google Drive or like in my case BitTorrent Sync. My working copies are located in the sync-folder, which is synced between my computer at work and at home. This causes some issues with permissions.

Hope it helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!