【问题标题】:INTELLIJ IDEA ERROR: "Can't start Git: /usr/bin/git Probably the path to Git executable is not valid. Fix it." How to Fix it?INTELLIJ IDEA 错误:“无法启动 Git:/usr/bin/git 可能是 Git 可执行文件的路径无效。修复它。”如何修复它?
【发布时间】:2019-03-28 10:36:09
【问题描述】:

我将我的 mac 更新到 macOS Mojave 版本 10.14,我已经在以前的操作系统版本中安装了 Xcode,现在当我运行 intelliJ 时抛出此错误:-

无法启动 Git:/usr/bin/git 可能 Git 可执行文件的路径是 无效。修复它

Screenshot of the error

【问题讨论】:

  • 尝试从控制台运行它(使用完整路径)。你有什么输出?
  • 如何从控制台运行它?
  • “如何从控制台运行它?” - 输入“git --version”!然后是“哪个 git”。但我敢打赌,你没有独立的“git”安装。所以解决方案是安装 git!
  • @StephenC 最好输入/usr/bin/git,因为这是 Idea 尝试运行的内容。
  • 除了“/usr/bin/git”不正确。查看错误信息!

标签: java git macos intellij-idea macos-mojave


【解决方案1】:

要解决这个问题,你需要安装 xcode 开发者工具。

运行这个命令,问题就解决了:

xcode-select --install

升级后我遇到了同样的问题,这解决了。

【讨论】:

    【解决方案2】:

    我执行了以下步骤来解决这个问题:

    1. 运行sudo xcode-select --switch /Application/Xcode.app/Contents/Developer(此步骤可能是可选的)
    2. 打开应用商店
    3. 更新xcode
    4. 等待更新完成,然后继续下一步
    5. 运行sudo xcodebuild -license
    6. enter键查看协议(向下翻页协议按住空格或按多次)
    7. 如果您同意,请在协议结束时输入 agree 并按 enter
    8. 关闭并重新打开 IntelliJ,GIT 应该会再次工作。

    我希望这对其他人有帮助!

    【讨论】:

    • 在运行 sudo xcodebuild -license 时收到此错误消息:xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
    • 你安装了xcode吗?活动开发目录可能不正确吗?
    猜你喜欢
    • 2015-12-16
    • 2016-02-29
    • 1970-01-01
    • 2022-08-13
    • 2016-10-19
    • 1970-01-01
    • 2016-12-31
    • 1970-01-01
    • 2013-08-15
    相关资源
    最近更新 更多