git 尝试在 checkout 时删除目录

标签 git git-checkout

每当我在分支 (Li) 和主分支之间切换时,我都会收到以下消息:

Deletion of directory 'sys/console/api' failed. Should I try again? (y/n)

任何人都知道如何摆脱这条消息?我认为过去我试图错误地删除这个目录,现在我被这个错误消息困住了。

最佳答案

此错误信息来自this patch (在 compat/mingw.c 中)和 this one (也在 compat/mingw.c 中)。
这通常意味着您的目录“忙”或不为空(但仅包含私有(private)文件,即非版本文件)。

因此请确保,在 checkout 分支时,您没有正在运行的进程使您的特定目录“繁忙”。

Ted M Young很有帮助comments :

Another definition of "busy" is that it's your current directory!
It seems safest to do a cd to the root directory and then change directories to avoid this error.

关于git 尝试在 checkout 时删除目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11923635/

相关文章:

php - Laravel 文件结构顶部的 ".phpintel"文件夹是什么?

Git checkout to a commit 2 commits before hash

git - 错误 : pathspec 'test-branch' did not match any file(s) known to git

macos - mac osx 上的 git : how to push filename cases to origin?

java - 对 Git (EGit) 感到困惑 - 工作区中的项目与本地存储库中的项目相同

Git:获取所有带有模式的 Blob

gitosis 更改服务器

git checkout 不会删除从未提交的暂存文件

git - Git提取无法解决git checkout上的pathspec错误— *

git - 在 Git 存储库中恢复已删除的文件夹