【问题标题】:how to fix the `error: bad fsmonitor version 2` in Windows Subsystem for Linux (WSL)?如何修复 Windows Subsystem for Linux (WSL) 中的 `error: bad fsmonitor version 2`?
【发布时间】:2021-11-16 11:15:50
【问题描述】:

我确实安装了 Git Bash(WSL2 在大型 git 存储库(如 llvm 和 webkit)上仍然非常慢)。 在 WSL2 Ubuntu 20.04 中:

matt@Surface2:/mnt/c/Users/matt/src/roact-alignment$ git --version
git version 2.25.1

在cmd中:

C:\Users\matt>git --version
git version 2.33.0.windows.1

即使没有打开 cmd,我也得到了这个用于 git 操作:

matt@Surface2:/mnt/c/Users/matt/src/roact-alignment$ git pull
error: bad fsmonitor version 2
error: bad fsmonitor version 2

【问题讨论】:

    标签: git visual-studio-code windows-subsystem-for-linux wsl-2


    【解决方案1】:

    我通过升级 git 解决了这个问题。

    # Add ppa of git
    sudo add-apt-repository ppa:git-core/ppa
    
    # Update sources
    sudo apt update
    
    # Upgrade git
    sudo apt upgrade
    

    更多详情,请看Page

    【讨论】:

      【解决方案2】:

      我认为在较新的 VS Code 中,它运行的是 win32 git 客户端。看来linux git客户端以某种方式连接到win32 fsmonitor“服务”。

      解决方案是更新 WSL2 中的 git 版本,使其更接近随 Git Bash 和/或 Visual Studio Code 安装的 git.exe。

      我按照说明在此处为 Ubuntu 添加了更新的 git 版本 PPA: https://git-scm.com/download/linux

      消息消失了!

      【讨论】:

        猜你喜欢
        • 2018-03-17
        • 1970-01-01
        • 2019-02-11
        • 2016-12-13
        • 2018-10-16
        • 2021-02-23
        • 1970-01-01
        • 2021-04-07
        • 1970-01-01
        相关资源
        最近更新 更多