Git 坏文件致命错误
Git 说我需要在快进之前拉动,但是当我发出 git pull origin master 时,它会返回此错误:
fatal: failed to read object 12786e6d70d76ce47ecf69c30e4d0f994d1e2fc3: Invalid argument
fatal: The remote end hung up unexpectedly
我尝试执行 git cat-file -t 12786e6d70d76ce47ecf69c30e4d0f994d1e2fc3 > 但这会返回12786e6d70d76ce47ecf69c30e4d0f994d1e2fc3:坏文件
如何查看哪个文件是坏文件以及如何修复它?
编辑:到战争基金!
编辑2:我可以删除所有内容并重新开始吗?
Git is saying that I need to pull before pushing to fast-forward but when I issue git pull origin master
it returns this error:
fatal: failed to read object 12786e6d70d76ce47ecf69c30e4d0f994d1e2fc3: Invalid argument
fatal: The remote end hung up unexpectedly
I tried doing git cat-file -t 12786e6d70d76ce47ecf69c30e4d0f994d1e2fc3
but that returns 12786e6d70d76ce47ecf69c30e4d0f994d1e2fc3: bad file
How do I see which file is the bad one and how can I fix it?
EDIT: To the war chest!
EDIT 2: can I just delete everything and begin again?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我删除了所有内容并再次拉动。无法完成任何工作,所以我不得不这样做:(任何有任何答案的人都可以随时发帖。
I deleted everything and pulled again. Couldn't get any work done so I had to do it :( Anyone who has any answers feel free to post.
我遇到同样的问题。幸运的是,可以通过 git cat-file命令找到另一台机器上的同一存储库。然而,该文件已被打包。
因此,我使用
该文件并将其复制到损坏的存储库计算机上,运行
然后,此问题得到解决。
这确实比从头开始获取更好。我有 30,000 个修订,从头开始恢复存储库至少需要 14 天。
I experience the same problem. Luckily, In the same repository in the other machine can be found by the
git cat-file <hash>
command. However, that file got packed.So, I use
and copied that file to the corrupt repository machine, run
And after that, this problem got resolved.
This is really better way than fetch from the beginning. I have 30,000 revisions and take at least 14 days to restore the repository from the beginning.
您是否尝试过 git clean && git pull ?您可能需要在发出命令之前备份未跟踪的文件。
Have you tried
git clean && git pull
? You might want to backup your untracked files prior to issuing the commands.当我收到
远程端意外挂起
(在 Windows 下)时,通常意味着包含origin
的网络驱动器未安装。您能否排除
git
只是存在连接问题?When I get
The remote end hung up unexpectedly
(under Windows) it usually means the network drive containingorigin
is not mounted.Can you rule out
git
was just having connection problems?“git checkout——”如果连接/身份验证正常工作,从根项目目录通常会为我修复此类错误。
"git checkout -- ." from the root project directory usually fixes such errors for me, if the connection / authentication is working .