git - 致命:未知的索引条目格式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47109232/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 12:58:08  来源:igfitidea点击:

git - fatal: Unknown index entry format

gitgithub

提问by Balaji Kartheeswaran

When I'm trying use git statusor git checkout masteror git pull,

当我试图使用git statusgit checkout master或者git pull

I'm getting an error:-

我收到一个错误:-

"fatal: Unknown index entry format 61740000".

“致命:未知的索引条目格式 61740000”。

I've tried to Reinitialize existing Git repository. But it did not fix the problem.

我试图重新初始化现有的 Git 存储库。但它并没有解决问题。

I'm new to git, and I have just made a first branch and make some changes and trying to commit the changes.

我是 git 的新手,我刚刚创建了第一个分支并进行了一些更改并尝试提交更改。

Tried searching on Google but can't find the right solution for the code 61740000.

尝试在 Google 上搜索,但找不到代码61740000的正确解决方案。

Edit: Deleted the whole local repository and then again cloned from remote repository (git status worked), created a branch (git status worked) and made changes to files (git status error).

编辑:删除整个本地存储库,然后再次从远程存储库克隆(git status 工作),创建一个分支(git status 工作)并对文件进行更改(git status 错误)。

Please help.

请帮忙。

回答by René H?hle

When your index is broken you can normally delete the index file and reset it.

当您的索引损坏时,您通常可以删除索引文件并重置它。

rm -f .git/index
git reset

or you clone the repo again.

或者你再次克隆回购。

回答by Super Jade

Regardless of the error code at the end of

不管最后的错误代码

fatal: Unknown index entry format

your git index file is corrupt. (I achieved this error after doing a find and replace for all files.)

您的 git 索引文件已损坏。(我在对所有文件进行查找和替换后遇到了这个错误。)



If using a Windows Command Prompt,

如果使用Windows 命令提示符

del .git\index

will delete the index file and

将删除索引文件和

git reset

will reset it.

将重置它。

Windows Command Prompt

Windows 命令提示符