使用msysgit 1.7.0.2,在执行git rebase -i
时,挂起并且没有消息。
输入ctrl+c后可以看到
'unlink of file failed, should I try again (y/n)?'
然后我尝试了 git rebase --abort
但得到了同样的错误信息。所以现在它停留在 rebase 过程的中间。这个错误似乎是由只读文件引起的。
有什么办法可以解决这个问题吗?
最佳答案
您尝试过 set GIT_ASK_YESNO=false
吗?
这个Google group thread在最近的mingw evolutions中提到了它:
Make use of the new environment variable
GIT_ASK_YESNO
to support the recently implemented fallback in caseunlink
,rename
orrmdir
fail for files in use on Windows.
您使用的是哪个版本的 Git for windows?
注: msysgit setup is not the same than the "Git for Windows" setup ,另见“Different between msysgit and cygwin + git ? ”)
git 2.8.4 (June 2016) 确实提到了 issue 755 这也应该可以缓解这个问题 ( commit 2db0641 ):
Make sure temporary file handles are not inherited by child processes
另请参阅 Git 2.19(2018 年第 3 季度):“Git - Unlink of file .idx and .pack failed (The only process owned handle to this file is git.exe)”。
关于Git rebase 出现 'unlink of file failed' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3698369/