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

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

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