为什么git pull挂起? [英] Why does git pull hang?

查看:89
本文介绍了为什么git pull挂起?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从git bash中执行git pull时,终端通常运行pull,更新本地,然后挂起.我不确定是否正在等待我做某事,但是通常我会使用CTRL-C退出.之后,我得到一个index.lock阻止我执行其他必须删除的操作.我误会了git pull的工作原理吗?

When I do a git pull, from the git bash, the terminal usually runs the pull, updates my local, and then hangs. I'm not sure if it's waiting for me to do something, but I usually exit out of this with CTRL-C. After that, I get that an index.lock is preventing me from doing other things to which I have to delete it. Am I misunderstanding how git pull works?

推荐答案

您可能需要删除不必要的git对象,例如dangling commits & blobs:

You may need to remove unnecessary git objects such as dangling commits & blobs:

git fsck && git gc --prune=now

git-fsck :验证数据库中对象的连接性和有效性
git-gc :清除不必要的文件并优化本地存储库

git-fsck : Verifies the connectivity and validity of the objects in the database
git-gc : Cleanup unnecessary files and optimize the local repository

您可以参考这里关于dangling commits & blobs.

这篇关于为什么git pull挂起?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆