为什么git pull挂起? [英] Why does git pull hang?
问题描述
当我从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 : 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屋!