取消链接文件失败 [英] Unlink of file failed
问题描述
取消文件lib / xxx.jar的链接'失败。我应该再试一次吗? (y / n)
无论我选择y还是n,都无法达到可以拉或推的状态。
通常意味着一个进程仍在使用该特定文件(仍然有句柄)
(在Windows上, ProcessExplorer
善于跟踪那种过程)
尝试关闭您的其他程序,然后重试您的 git pull
。
请注意,您可以使用 GIT_ASK_YESNO
变量。
2016年1月更新
这应该在Git 2.8(2016年3月)中修正
请参阅提交d562102 ,提交dcacb1b , commit df617b5 ,提交0898c96 (2016年1月13日)通过 Johannes Schindelin( dscho
)。
(由 Junio C Hamano - <$ c $合并c> gitster - 位于提交3c80940 ,2016年1月26日)
fetch
垃圾收集
在auto-gc'ing之前,我们需要确保包文件在需要重新包装的情况下发布和垃圾收集。
许多代码路径在退出保持包文件映射并将文件描述符保留给它们之前运行
gc --auto
打开,对不能移除打开文件的系统不友好。
现在关闭它们。
修复了 git-for-widows
issue 500 。
git config gc.autoPackLimit 10000
git fetch
git config gc.autoPackLimit 50#默认值
git 2.8.4(2016年6月)提及 issue 755 ,这也可以缓解这个问题( commit 2db0641 ):
lockquote
确保临时文件句柄不被子进程
I'm trying to do a git pull and I get the following error:
Unlink of file 'lib/xxx.jar' failed. Should I try again? (y/n)
No matter if I select y or n it's not possible to get to a state where I can pull or push.
That usually means a process is still using that specific file (still has an handle on it)
(on Windows, ProcessExplorer
is good at tracking that kind of process)
Try closing your other programs, and try again your git pull
.
Note that you have an alternative with the GIT_ASK_YESNO
variable.
Update January 2016
That should be fixed in Git 2.8 (March 2016)
See commit d562102, commit dcacb1b, commit df617b5, commit 0898c96 (13 Jan 2016) by Johannes Schindelin (dscho
).
(Merged by Junio C Hamano -- gitster
-- in commit 3c80940, 26 Jan 2016)
fetch
: release pack files before garbage-collectingBefore 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.
That fixes git-for-widows
issue 500.
Looking at the test used to validate that new approach, a possible workaround (since Git 2.8 is not yet out) would be to raise artificially gc.autoPackLimit
.
git config gc.autoPackLimit 10000
git fetch
git config gc.autoPackLimit 50 # default value
git 2.8.4 (June 2016) does mention issue 755 which should also alleviate the issue (commit 2db0641):
Make sure temporary file handles are not inherited by child processes
这篇关于取消链接文件失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!