Git pull, fatal: loose object

不想你离开。 提交于 2019-12-10 13:54:24

问题


My colleague tried to do a git pull from our master. He got this error:

$ git pull
fatal: loose object f7630cc30248df1e19bcb40c9de1b60b71cdfce1 (stored in ./objects/f7/630cc30248df1e19bcb40c9de1b60b71cdfce1) is corrupt
fatal: The remote end hung up unexpectedly

Luckily, my repo seems not to be corrupt, and I do have a copy of f7630cc30248df1e19bcb40c9de1b60b71cdfce1. But I can't figure out what he needs to do with it. We tried just taking my copy & putting it in his .git/objects/f7/ directory, but the error message stays the same.

Is it supposed to be as simple as just shuffling files around, or do we need to do something else?


回答1:


Does that file exist loose on the master? If so, is it valid or corrupt there? Yes, it should be sufficient just to copy a good version of the file into the objects directory.




回答2:


Check the .git/objects directory for files not readable by you. I had this problem and that was the issue. A coworker had cloned my repo while the central server was down, and (I think) a push ended up putting files owned by him but not readable by me.



来源:https://stackoverflow.com/questions/8438620/git-pull-fatal-loose-object

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