• 请不要在回答技术问题时复制粘贴 AI 生成的内容
ywcjxf1515
V2EX  ›  程序员

windows 上用 claude code,使用是 git bash 报错

  •  
  •   ywcjxf1515 · Jul 21 · 1387 views
    你们在 windows 上用 claude code ,使用的是 git bash
    会不会经常报 Error: Exit code 5
    0 [main] bash (6336) C:\Program Files\Git\bin\..\usr\bin\bash.exe: *** fatal error - add_item
    ("\??\C:\Program Files\Git", "/", ...) failed, errno 1


    已经把 hook 都改走 powershell
    还是会有 我怀疑是 statusline 不断调用 git bash 的问题
    Supplement 1  ·  Jul 21
    我现在是 agent 写了一个 c# exe ,里面是进程锁,相当于让 git bash 串行了
    10 replies    2026-07-21 17:45:25 +08:00
    YanSeven
        1
    YanSeven  
       Jul 21
    让 claude code 自己原地诊断
    ywcjxf1515
        2
    ywcjxf1515  
    OP
       Jul 21 via Android
    试了 其中一个版本说是起太多 git bash 进程的问题
    leihaibo1992
        3
    leihaibo1992  
       Jul 21
    windows 上还是 powershell7 比较稳,或者上 wsl ,Git Bash 非常垃圾
    leihaibo1992
        4
    leihaibo1992  
       Jul 21
    这些大厂的 agent 产品都优先考虑 mac 用户,windows 体验做到很烂,请体验一下我做的 octo-agent ( https://v2ex.com/t/1228101 ),所有操作系统都是第一公民,windows 小白用户都能立刻上手
    yidinghe
        5
    yidinghe  
    PRO
       Jul 21
    一定要用 bash 的话,就在 WSL 里面用吧
    zuosiruan
        6
    zuosiruan  
       Jul 21
    上面说的对,上 powershell7 ,巨稳定
    ywcjxf1515
        7
    ywcjxf1515  
    OP
       Jul 21
    @zuosiruan claude code 不会一堆重试 为了跑对 powershell 命令
    WashFreshFresh
        8
    WashFreshFresh  
       Jul 21
    换个思路 我是在 git bash 里切到项目路径 然后气动的 claude 目前命令使用的都正常
    ywcjxf1515
        9
    ywcjxf1515  
    OP
       Jul 21
    @WashFreshFresh 原理是?
    ywcjxf1515
        10
    ywcjxf1515  
    OP
       Jul 21
    我现在是 agent 写了一个 c# exe ,里面是进程锁,相当于让 git bash 串行了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   996 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 19:12 · PVG 03:12 · LAX 12:12 · JFK 15:12
    ♥ Do have faith in what you're doing.