代码之家  ›  专栏  ›  技术社区  ›  SeanRamey

将git添加到Windows上的路径会导致中断吗?

  •  1
  • SeanRamey  · 技术社区  · 7 年前

    我安装了Git for Windows(便携式版本),并添加了 "C:/Program Files/Git/bin" 到我的系统路径变量。当我这么做的时候,它把我从Mingw-w64安装的make搞砸了。

    当我运行命令生成我的项目时( make all ),我得到这个错误:

    process_begin: CreateProcess(NULL, echo compiling src/prototype-main.cpp, ...) failed.
    make (e=2): The system cannot find the file specified.
    make: *** [make/targets.make:40: src/prototype-main.o] Error 2
    

    "Git/bin" 目录是:

    bash.exe
    git.exe
    sh.exe
    
    2 回复  |  直到 7 年前
        1
  •  1
  •   SeanRamey    7 年前

    我发现你需要把 "cmd" 目录插入到路径中,而不是 "bin" make 如果你把 “垃圾桶” 路径上的目录。

    在Git for Windows的可移植版本中,有一个名为 "README.portable" . 它告诉您(或者使用gitbash或gitcmd终端)将 路径上的目录并使用 git 直接地

    如果有人知道为什么 如果 目录在路径上,我仍然想知道发生了什么。