windows - Windows 上的 git (git-bash) 即使完成后也会锁定文件夹数量

标签 windows git git-bash filelock

我通常使用 git-bash 从 Windows 桌面管理源代码。完成后,我关闭 git-bash 窗口或运行 exit 命令。

然后,我注意到很多用于 git 项目的文件夹都被 git 锁定了。释放锁的唯一方法是杀死 git 进程。

使用 git 完成后有没有办法关闭 git 及其所有进程?

现在,我正在使用 PowerShell 来跟踪锁定的文件并终止相关进程:

PS> openfiles /query | find "folder-name"
PS> taskkill /im git.exe

enter image description here

注意:我使用 Windows Process Explorer 文件句柄搜索实用程序注意到文件锁定。我必须以管理员权限运行该实用程序才能使用此功能来查找锁。请参阅下面的快照。

感谢您的帮助。

Process Explorer File Handle Search 塔里克

最佳答案

安装适用于 Windows 的新版 Git 并禁用文件系统监视程序应该可以修复目录锁定(这会影响 core.useBuiltinFSMonitor 设置):

Git for Windows fsmonitor

关于windows - Windows 上的 git (git-bash) 即使完成后也会锁定文件夹数量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70624909/

相关文章:

c++ - 适用于 Windows 和 Linux 的 Visual Studio 2010 项目

c++ - Linux 和 Windows c++ 上的低级文件操作处理

python - git graph父子表格格式

GIT-IntelliJ : Failed to start Git process

windows - AutoHotKey:如何获取 find 命令的错误级别?

python - Pandas read_csv 可以将文件锁定在 Windows 上

windows - Git 推送在 Windows 7 上的 “Writing Objects: 100%” 停止

Laravel 5 制作 :controller creating controller in app folder instead of controller folder

python -/bin/env : python: No such file or directory (Windows through Git Bash trying to install new Parse Cloud Code)

git - 如何着色 git push 输出