Git rebase 出现 'unlink of file failed' 错误

标签 git

使用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 case unlink, rename or rmdir 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/

相关文章:

android - Git 新手,从 Android Studio 开始

git - 警告 : You ran 'git add' with neither '-A (--all)' or '--ignore-removal'

java.lang.UnsupportedClassVersionError : com/android/build/gradle/AppPlugin : Unsupported major. 次要版本 52.0

git - Qt Creator Git, checkout 命令

windows - 如何在Linux下检查字符集错误的git仓库?

git - 为什么在我的 rebase 操作中只有一次提交而不是两次发生冲突?

Git 标签 checkout 和 git hook

Android Studio 启动时修改./idea/vcs.xml

git - Ansible git 模块不 checkout 分支

java - 如何创建一个 git hook 来强制我编写 javadoc 注释?