git pull 导致 "unlink of file failed"错误

标签 git

我正在尝试执行 git pull 并遇到了可怕的“文件 xxx 的取消链接失败”错误。

我已经尝试过 this 中定义的 ProcessExplorer回答;使用查找函数不会返回任何使用相关文件的进程。

我也试过运行 git gc,如 this 中所述回答,它运行,但我仍然收到错误。

我对相关文件有写权限。

还有其他建议吗?这导致了一个主要问题。

最佳答案

这应该在 Git 2.8(2016 年 3 月)中修复

参见 commit d562102 , commit dcacb1b , commit df617b5 , commit 0898c96 (2016 年 1 月 13 日)作者:Johannes Schindelin (dscho) .
(由 Junio C Hamano -- gitster -- merge 于 commit 3c80940 ,2016 年 1 月 26 日)

fetch: release pack files before garbage-collecting

Before auto-gc'ing, we need to make sure that the pack files are released in case they need to be repacked and garbage-collected.

Many codepaths that run "gc --auto" before exiting kept packfiles mapped and left the file descriptors to them open, which was not friendly to systems that cannot remove files that are open.
They now close the packs before doing so.

这修复了 git-for-widows issue 500 .

查看 test used to validate that new approach ,也许你可以(因为 Git 2.8 还没有出来)人为地提高 gc.autoPackLimit

git config gc.autoPackLimit 10000
git fetch
git config gc.autoPackLimit 50 # default value

关于git pull 导致 "unlink of file failed"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34998809/

相关文章:

git 忽略文件仍然提交日志

git - 如何删除本地 git 存储库中的最后一次提交

git - 如果使用 Mercurial 或 Git,经常提交文件好吗?

git - 如何撤消 git 流功能完成?

git - 如何禁用关于 git 初始分支名称的 git 消息

git - stash , pull 和 pop 与提交和 pull --rebase之间有重要区别吗?

git - Tortoise Git - 'Reset "master“到此”不起作用

git - Jenkins Git 插件 - stderr : plink: unknown option "-o"

Git 从所有提交中删除文件

git - `git merge -s theirs` 需要但不存在