git pull报错

栏目: 编程工具 · 发布时间: 7年前

内容简介:在git pull时,偶尔会遇到一个报错:不管是y还是n都会不断地出现这种提示信息。有人说文件被占用了,这个没有试过,如果真的文件被占用了,关掉被占用的文件即可(文件夹也需要关闭)。

在git pull时,偶尔会遇到一个报错:

Unlink of file '.git/objects/pack/old-07de1ebcd020b809a421fceb567977352258b859.idx' failed. Should I try again? (y/n)

不管是y还是n都会不断地出现这种提示信息。

有人说文件被占用了,这个没有试过,如果真的文件被占用了,关掉被占用的文件即可(文件夹也需要关闭)。

看到有个提示信息:

remote: Counting objects: 16, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 16 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (16/16), done.
From 10.8.5.131:technique/documents
   fd56988..5662668  master     -> origin/master
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
Counting objects: 19017, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6867/6867), done.
Writing objects: 100% (19017/19017), done.
Total 19017 (delta 11875), reused 18994 (delta 11863)
Unlink of file '.git/objects/pack/old-07de1ebcd020b809a421fceb567977352258b859.idx' failed. Should I try again? (y/n)

git help gc

虽然提示信息中并没有说因为什么,不过按照提示,可以查看一个git gc的内容。

果然,执行git gc就可以达到效果了。

$ git gc --auto
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
Counting objects: 19017, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6855/6855), done.
Writing objects: 100% (19017/19017), done.
Total 19017 (delta 11875), reused 19017 (delta 11875)
Removing duplicate objects: 100% (256/256), done.

最后有个提示:

Removing duplicate objects

也就是说这个问题是因为重复文件导致的。

再继续git pull,一切ok了。


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

使用HTML5和Node构建超媒体API

使用HTML5和Node构建超媒体API

【美】Mike Amundsen(麦克.阿蒙森) / 臧秀涛 / 电子工业出版社 / 2014-5 / 55.00元

《使用HTML5和Node构建超媒体API》探讨了超媒体API 的设计,介绍了作为超媒体API 的构件块的超媒体因子,并讲解了基本格式、状态转移、领域风格和应用流程这4 种超媒体设计元素;之后作者结合具体的场景,通过3个动手实验章节,从超媒体因子和超媒体设计元素入手,用实际的代码向我们详细地演示了超媒体API 的设计;最后介绍了超媒体设计的文档编写、注册与发布等内容。 《使用HTML5和No......一起来看看 《使用HTML5和Node构建超媒体API》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码