git Github 推送错误:解包失败:index-pack 异常退出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13963527/
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 07:54:24  来源:igfitidea点击:

Github push error: unpack failed: index-pack abnormal exit

gitgithub

提问by Kunal

I'm having issues pushing a new git changeset to the github repository. First I cloned my local changes with a depth of 1 to remove the history as:

我在将新的 git 变更集推送到 github 存储库时遇到问题。首先,我克隆了深度为 1 的本地更改以删除历史记录:

git clone --depth 1 file:///Users/kunal<path to project>

Then I ran a git init remote add and push as inside of the directory I cloned:

然后我在我克隆的目录中运行了一个 git init remote add 和 push :

> git init  
> git remote add origin https://github.com/kp27/pymovie2.git 

> git push -u origin master

I see the files upload, but then I get:

我看到文件上传,但后来我得到:

Counting objects: 7110, done.

Delta compression using up to 8 threads.

Compressing objects: 100% (3785/3785), done.

Writing objects: 100% (7110/7110), 7.60 MiB | 247 KiB/s, done.

Total 7110 (delta 2283), reused 7110 (delta 2283)

error: unpack failed: index-pack abnormal exit

Any ideas what could be causing this? My first guess is the depth of 1 is causing it, but I am not sure why.

任何想法可能导致这种情况?我的第一个猜测是 1 的深度导致了它,但我不确定为什么。

回答by Paul

I deleted contents of /.git/ and tried again - it worked. Be careful doing this.

我删除了 /.git/ 的内容并再次尝试 - 它起作用了。做这件事要小心。

Story: I had similar problem related to some error in renaming folders, which persisted even after deletion and (re-)cloning

故事:我在重命名文件夹时遇到了类似的问题,即使在删除和(重新)克隆后仍然存在

(on mac os x): I first copied my files to a safe directoryon computer, then navigated into /.git/ and deleted all contents (cmd-shift-g ".git" in Finder) and finally deleted /.git/ in terminal

(在 mac os x 上):我首先将文件复制到计算机上的安全目录,然后导航到 /.git/ 并删除所有内容(Finder 中的 cmd-shift-g ".git"),最后删除 /.git/在终端

then was able to commit and push

然后能够提交和推送

回答by Peter van der Does

You need to contact github for this, it's something on the receiving end.

你需要为此联系github,它是接收端的东西。

You could also clone the github repository and instead of cloning your local files, just copy them over and add them.

您也可以克隆 github 存储库,而不是克隆本地文件,只需将它们复制并添加即可。

回答by Varun Sharma

For me this happened, when I tried to push the new files which are not added to the index. try adding the files to index using Team-> Add To Index in eclipse thru EGit plugin.

对我来说,这发生在我尝试推送未添加到索引中的新文件时。尝试使用 Team-> Add To Index 在 Eclipse 中通过 EGit 插件将文件添加到索引。

回答by Adam111p

I had the same case, not gitgub, but for another repo git. If you can, check if the userwho is loggedin with git has permission to writeto these directories, and if not then in chmodand continue to know you already know...

我有同样的情况,不是 gitgub,而是另一个 repo git。如果可以,请检查使用 git登录用户是否具有写入这些目录的权限,如果没有,则在chmod 中继续知道您已经知道...

回答by Valerii Rusakov

In case of repack didn't help pull with rebase can help:

如果重新打包没有帮助,使用 rebase 可以帮助:

git pull --rebase

回答by Parteek Singla

You don't need to clone it again, just run this command in git repo git repack remote/origin/masterFor more details check out this http://www.andyjarrett.co.uk/2009/10/08/unpacker-error-when-pushing-git/

您不需要再次克隆它,只需在 git repo 中运行此命令git repack remote/origin/master有关更多详细信息,请查看此http://www.andyjarrett.co.uk/2009/10/08/unpacker-error-when-pushing-git /